From 4976cb9218ce7d51786c0ab6ee5e9ea9db47a377 Mon Sep 17 00:00:00 2001 From: Rohit Ramkumar Date: Tue, 30 Jan 2018 12:51:59 -0800 Subject: [PATCH] Fixes ci-ingress-gce-upgrade-e2e --- test/e2e/framework/nodes_util.go | 1 - test/e2e/framework/util.go | 1 + .../ingress/static-ip-2/ing.yaml | 11 ++++-- test/e2e/upgrades/ingress.go | 34 ++++++++----------- 4 files changed, 23 insertions(+), 24 deletions(-) diff --git a/test/e2e/framework/nodes_util.go b/test/e2e/framework/nodes_util.go index 44e04647026..8c8d704b027 100644 --- a/test/e2e/framework/nodes_util.go +++ b/test/e2e/framework/nodes_util.go @@ -86,7 +86,6 @@ func ingressUpgradeGCE(isUpgrade bool) error { command = "sudo sed -i -re 's/(image:)(.*)/\\1 gcr.io\\/google_containers\\/glbc:0.9.7/' /etc/kubernetes/manifests/glbc.manifest" } sshResult, err := NodeExec(GetMasterHost(), command) - // TODO(rramkumar): Ensure glbc pod is in "Running" state before proceeding. LogSSHResult(sshResult) return err } diff --git a/test/e2e/framework/util.go b/test/e2e/framework/util.go index b8d18530a0c..646f2c6f685 100644 --- a/test/e2e/framework/util.go +++ b/test/e2e/framework/util.go @@ -4947,6 +4947,7 @@ func PollURL(route, host string, timeout time.Duration, interval time.Duration, Logf("host %v path %v: %v unreachable", host, route, err) return expectUnreachable, nil } + Logf("host %v path %v: reached", host, route) return !expectUnreachable, nil }) if pollErr != nil { diff --git a/test/e2e/testing-manifests/ingress/static-ip-2/ing.yaml b/test/e2e/testing-manifests/ingress/static-ip-2/ing.yaml index 097854434e2..f96c868a6ef 100644 --- a/test/e2e/testing-manifests/ingress/static-ip-2/ing.yaml +++ b/test/e2e/testing-manifests/ingress/static-ip-2/ing.yaml @@ -6,6 +6,11 @@ metadata: # annotations: # kubernetes.io/ingress.global-static-ip-name: "staticip" spec: - backend: - serviceName: echoheaders-https - servicePort: 80 + rules: + - host: ingress.test.com + http: + paths: + - path: /foo + backend: + serviceName: echoheaders-https + servicePort: 80 diff --git a/test/e2e/upgrades/ingress.go b/test/e2e/upgrades/ingress.go index 40a142fff44..010f2c8fbce 100644 --- a/test/e2e/upgrades/ingress.go +++ b/test/e2e/upgrades/ingress.go @@ -32,6 +32,10 @@ import ( "k8s.io/kubernetes/test/e2e/framework" ) +// Dependent on "static-ip-2" manifests +const path = "foo" +const host = "ingress.test.com" + // IngressUpgradeTest adapts the Ingress e2e for upgrade testing type IngressUpgradeTest struct { gceController *framework.GCEIngressController @@ -93,10 +97,10 @@ func (t *IngressUpgradeTest) Setup(f *framework.Framework) { "kubernetes.io/ingress.global-static-ip-name": t.ipName, "kubernetes.io/ingress.allow-http": "false", }, map[string]string{}) - jig.AddHTTPS("tls-secret", "ingress.test.com") + t.jig.AddHTTPS("tls-secret", "ingress.test.com") By("waiting for Ingress to come up with ip: " + t.ip) - framework.ExpectNoError(framework.PollURL(fmt.Sprintf("https://%v/", t.ip), "", framework.LoadBalancerPollTimeout, jig.PollInterval, t.httpClient, false)) + framework.ExpectNoError(framework.PollURL(fmt.Sprintf("https://%v/%v", t.ip, path), host, framework.LoadBalancerPollTimeout, t.jig.PollInterval, t.httpClient, false)) By("keeping track of GCP resources created by Ingress") t.resourceStore = &GCPResourceStore{} @@ -145,35 +149,25 @@ func (t *IngressUpgradeTest) verify(f *framework.Framework, done <-chan struct{} if testDuringDisruption { By("continuously hitting the Ingress IP") wait.Until(func() { - framework.ExpectNoError(framework.PollURL(fmt.Sprintf("https://%v/", t.ip), "", framework.LoadBalancerPollTimeout, t.jig.PollInterval, t.httpClient, false)) + framework.ExpectNoError(framework.PollURL(fmt.Sprintf("https://%v/%v", t.ip, path), host, framework.LoadBalancerPollTimeout, t.jig.PollInterval, t.httpClient, false)) }, t.jig.PollInterval, done) } else { By("waiting for upgrade to finish without checking if Ingress remains up") <-done } By("hitting the Ingress IP " + t.ip) - framework.ExpectNoError(framework.PollURL(fmt.Sprintf("https://%v/", t.ip), "", framework.LoadBalancerPollTimeout, t.jig.PollInterval, t.httpClient, false)) + framework.ExpectNoError(framework.PollURL(fmt.Sprintf("https://%v/%v", t.ip, path), host, framework.LoadBalancerPollTimeout, t.jig.PollInterval, t.httpClient, false)) // We want to manually trigger a sync because then we can easily verify // a correct sync completed after update. By("updating ingress spec to manually trigger a sync") t.jig.Update(func(ing *extensions.Ingress) { - ing.Spec.TLS[0].Hosts = append(ing.Spec.TLS[0].Hosts, "ingress.test.com") - ing.Spec.Rules = append( - ing.Spec.Rules, - extensions.IngressRule{ - Host: "ingress.test.com", - IngressRuleValue: extensions.IngressRuleValue{ - HTTP: &extensions.HTTPIngressRuleValue{ - Paths: []extensions.HTTPIngressPath{ - { - Path: "/test", - // Note: Dependant on using "static-ip-2" manifest. - Backend: *(ing.Spec.Backend), - }, - }, - }, - }, + ing.Spec.Rules[0].IngressRuleValue.HTTP.Paths = append( + ing.Spec.Rules[0].IngressRuleValue.HTTP.Paths, + extensions.HTTPIngressPath{ + Path: "/test", + // Note: Dependant on using "static-ip-2" manifest. + Backend: ing.Spec.Rules[0].IngressRuleValue.HTTP.Paths[0].Backend, }) }) // WaitForIngress() tests that all paths are pinged, which is how we know