From 430b8e69813f73477a78cc868bef696b108e76a1 Mon Sep 17 00:00:00 2001 From: srikiz Date: Tue, 25 Jan 2022 18:56:47 +0530 Subject: [PATCH 1/2] fix ingress path when validating webhook for ingress is in place while tests are running --- test/e2e/network/ingress.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/e2e/network/ingress.go b/test/e2e/network/ingress.go index 951d6fc356a..07654bee184 100644 --- a/test/e2e/network/ingress.go +++ b/test/e2e/network/ingress.go @@ -20,6 +20,7 @@ import ( "context" "encoding/json" "fmt" + "math/rand" "path/filepath" "time" @@ -634,7 +635,7 @@ var _ = common.SIGDescribe("Ingress API", func() { IngressRuleValue: networkingv1.IngressRuleValue{ HTTP: &networkingv1.HTTPIngressRuleValue{ Paths: []networkingv1.HTTPIngressPath{{ - Path: "/", + Path: "/testpath/" + fmt.Sprintf("%08x", rand.Int31()), PathType: &prefixPathType, Backend: networkingv1.IngressBackend{ Service: &networkingv1.IngressServiceBackend{ From b4dd9cb388a5f2e8582b75b75e54748026f45512 Mon Sep 17 00:00:00 2001 From: srikiz Date: Tue, 25 Jan 2022 20:11:12 +0530 Subject: [PATCH 2/2] incorporate review comments --- test/e2e/network/ingress.go | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/test/e2e/network/ingress.go b/test/e2e/network/ingress.go index 07654bee184..c44bfd0af6b 100644 --- a/test/e2e/network/ingress.go +++ b/test/e2e/network/ingress.go @@ -20,7 +20,6 @@ import ( "context" "encoding/json" "fmt" - "math/rand" "path/filepath" "time" @@ -635,7 +634,7 @@ var _ = common.SIGDescribe("Ingress API", func() { IngressRuleValue: networkingv1.IngressRuleValue{ HTTP: &networkingv1.HTTPIngressRuleValue{ Paths: []networkingv1.HTTPIngressPath{{ - Path: "/testpath/" + fmt.Sprintf("%08x", rand.Int31()), + Path: "/", PathType: &prefixPathType, Backend: networkingv1.IngressBackend{ Service: &networkingv1.IngressServiceBackend{ @@ -653,6 +652,14 @@ var _ = common.SIGDescribe("Ingress API", func() { }, Status: networkingv1.IngressStatus{LoadBalancer: v1.LoadBalancerStatus{}}, } + + ingress1 := ingTemplate.DeepCopy() + ingress1.Spec.Rules[0].Host = "host1.bar.com" + ingress2 := ingTemplate.DeepCopy() + ingress2.Spec.Rules[0].Host = "host2.bar.com" + ingress3 := ingTemplate.DeepCopy() + ingress3.Spec.Rules[0].Host = "host3.bar.com" + // Discovery ginkgo.By("getting /apis") { @@ -709,11 +716,11 @@ var _ = common.SIGDescribe("Ingress API", func() { // Ingress resource create/read/update/watch verbs ginkgo.By("creating") - _, err := ingClient.Create(context.TODO(), ingTemplate, metav1.CreateOptions{}) + _, err := ingClient.Create(context.TODO(), ingress1, metav1.CreateOptions{}) framework.ExpectNoError(err) - _, err = ingClient.Create(context.TODO(), ingTemplate, metav1.CreateOptions{}) + _, err = ingClient.Create(context.TODO(), ingress2, metav1.CreateOptions{}) framework.ExpectNoError(err) - createdIngress, err := ingClient.Create(context.TODO(), ingTemplate, metav1.CreateOptions{}) + createdIngress, err := ingClient.Create(context.TODO(), ingress3, metav1.CreateOptions{}) framework.ExpectNoError(err) ginkgo.By("getting")