mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-06 10:43:56 +00:00
[e2e ingress-gce] Implement Skip() for ingress upgrade test
This commit is contained in:
parent
9f7348ed50
commit
aaf74aecf0
@ -29,6 +29,7 @@ import (
|
|||||||
compute "google.golang.org/api/compute/v1"
|
compute "google.golang.org/api/compute/v1"
|
||||||
extensions "k8s.io/api/extensions/v1beta1"
|
extensions "k8s.io/api/extensions/v1beta1"
|
||||||
"k8s.io/apimachinery/pkg/util/wait"
|
"k8s.io/apimachinery/pkg/util/wait"
|
||||||
|
"k8s.io/kubernetes/pkg/util/version"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -45,6 +46,7 @@ type IngressUpgradeTest struct {
|
|||||||
httpClient *http.Client
|
httpClient *http.Client
|
||||||
ip string
|
ip string
|
||||||
ipName string
|
ipName string
|
||||||
|
skipSSLCheck bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// GCPResourceStore keeps track of the GCP resources spun up by an ingress.
|
// GCPResourceStore keeps track of the GCP resources spun up by an ingress.
|
||||||
@ -145,6 +147,26 @@ func (t *IngressUpgradeTest) Teardown(f *framework.Framework) {
|
|||||||
framework.ExpectNoError(t.gceController.CleanupGCEIngressController())
|
framework.ExpectNoError(t.gceController.CleanupGCEIngressController())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Skip checks if the test or part of the test should be skipped.
|
||||||
|
func (t *IngressUpgradeTest) Skip(upgCtx UpgradeContext) bool {
|
||||||
|
sslNameChangeVersion, err := version.ParseGeneric("v1.10.0")
|
||||||
|
framework.ExpectNoError(err)
|
||||||
|
var hasVersionBelow, hasVersionAboveOrEqual bool
|
||||||
|
for _, v := range upgCtx.Versions {
|
||||||
|
if v.Version.LessThan(sslNameChangeVersion) {
|
||||||
|
hasVersionBelow = true
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
hasVersionAboveOrEqual = true
|
||||||
|
}
|
||||||
|
// Skip SSL certificates check if k8s version changes between 1.10-
|
||||||
|
// and 1.10+ because the naming scheme has changed.
|
||||||
|
if hasVersionBelow && hasVersionAboveOrEqual {
|
||||||
|
t.skipSSLCheck = true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
func (t *IngressUpgradeTest) verify(f *framework.Framework, done <-chan struct{}, testDuringDisruption bool) {
|
func (t *IngressUpgradeTest) verify(f *framework.Framework, done <-chan struct{}, testDuringDisruption bool) {
|
||||||
if testDuringDisruption {
|
if testDuringDisruption {
|
||||||
By("continuously hitting the Ingress IP")
|
By("continuously hitting the Ingress IP")
|
||||||
@ -184,6 +206,11 @@ func (t *IngressUpgradeTest) verify(f *framework.Framework, done <-chan struct{}
|
|||||||
for _, ig := range postUpgradeResourceStore.IgList {
|
for _, ig := range postUpgradeResourceStore.IgList {
|
||||||
ig.Size = 0
|
ig.Size = 0
|
||||||
}
|
}
|
||||||
|
// Stub out compute.SslCertificates in case we know it will change during an upgrade/downgrade.
|
||||||
|
if t.skipSSLCheck {
|
||||||
|
t.resourceStore.SslList = nil
|
||||||
|
postUpgradeResourceStore.SslList = nil
|
||||||
|
}
|
||||||
|
|
||||||
framework.ExpectNoError(compareGCPResourceStores(t.resourceStore, postUpgradeResourceStore, func(v1 reflect.Value, v2 reflect.Value) error {
|
framework.ExpectNoError(compareGCPResourceStores(t.resourceStore, postUpgradeResourceStore, func(v1 reflect.Value, v2 reflect.Value) error {
|
||||||
i1 := v1.Interface()
|
i1 := v1.Interface()
|
||||||
|
Loading…
Reference in New Issue
Block a user