From b21e2fc95e062e3f6868d7416658fddb3e78ad79 Mon Sep 17 00:00:00 2001 From: Pavels Fjodorovs Date: Fri, 24 Mar 2023 13:39:27 +0100 Subject: [PATCH 1/3] Retain TLS configuration for canary ingresses in the nginx integration Signed-off-by: Pavels Fjodorovs --- rollout/trafficrouting/nginx/nginx.go | 20 ++- rollout/trafficrouting/nginx/nginx_test.go | 148 +++++++++++++++++++++ 2 files changed, 164 insertions(+), 4 deletions(-) diff --git a/rollout/trafficrouting/nginx/nginx.go b/rollout/trafficrouting/nginx/nginx.go index 2964cd5f39..3d56c55f6a 100644 --- a/rollout/trafficrouting/nginx/nginx.go +++ b/rollout/trafficrouting/nginx/nginx.go @@ -66,8 +66,6 @@ func (r *Reconciler) buildCanaryIngress(stableIngress *networkingv1.Ingress, nam canaryServiceName := r.cfg.Rollout.Spec.Strategy.Canary.CanaryService annotationPrefix := defaults.GetCanaryIngressAnnotationPrefixOrDefault(r.cfg.Rollout) - // Set up canary ingress resource, we do *not* have to duplicate `spec.tls` in a canary, only - // `spec.rules` desiredCanaryIngress := &networkingv1.Ingress{ ObjectMeta: metav1.ObjectMeta{ Name: name, @@ -78,6 +76,14 @@ func (r *Reconciler) buildCanaryIngress(stableIngress *networkingv1.Ingress, nam }, } + // Preserve TLS from stable ingress + if stableIngress.Spec.TLS != nil { + desiredCanaryIngress.Spec.TLS = make([]networkingv1.IngressTLS, len(stableIngress.Spec.TLS)) + for it := 0; it < len(stableIngress.Spec.TLS); it++ { + stableIngress.Spec.TLS[it].DeepCopyInto(&desiredCanaryIngress.Spec.TLS[it]) + } + } + // Preserve ingressClassName from stable ingress if stableIngress.Spec.IngressClassName != nil { desiredCanaryIngress.Spec.IngressClassName = stableIngress.Spec.IngressClassName @@ -136,8 +142,6 @@ func (r *Reconciler) buildLegacyCanaryIngress(stableIngress *extensionsv1beta1.I canaryServiceName := r.cfg.Rollout.Spec.Strategy.Canary.CanaryService annotationPrefix := defaults.GetCanaryIngressAnnotationPrefixOrDefault(r.cfg.Rollout) - // Set up canary ingress resource, we do *not* have to duplicate `spec.tls` in a canary, only - // `spec.rules` desiredCanaryIngress := &extensionsv1beta1.Ingress{ ObjectMeta: metav1.ObjectMeta{ Name: name, @@ -148,6 +152,14 @@ func (r *Reconciler) buildLegacyCanaryIngress(stableIngress *extensionsv1beta1.I }, } + // Preserve TLS from stable ingress + if stableIngress.Spec.TLS != nil { + desiredCanaryIngress.Spec.TLS = make([]extensionsv1beta1.IngressTLS, len(stableIngress.Spec.TLS)) + for it := 0; it < len(stableIngress.Spec.TLS); it++ { + stableIngress.Spec.TLS[it].DeepCopyInto(&desiredCanaryIngress.Spec.TLS[it]) + } + } + // Preserve ingressClassName from stable ingress if stableIngress.Spec.IngressClassName != nil { desiredCanaryIngress.Spec.IngressClassName = stableIngress.Spec.IngressClassName diff --git a/rollout/trafficrouting/nginx/nginx_test.go b/rollout/trafficrouting/nginx/nginx_test.go index d597b1187e..4d1d26ea98 100644 --- a/rollout/trafficrouting/nginx/nginx_test.go +++ b/rollout/trafficrouting/nginx/nginx_test.go @@ -212,6 +212,48 @@ func checkBackendServiceLegacy(t *testing.T, ing *extensionsv1beta1.Ingress, ser assert.Fail(t, msg) } +func checkTLS(t *testing.T, ing *ingressutil.Ingress, hosts [][]string, secretNames []string) { + t.Helper() + switch ing.Mode() { + case ingressutil.IngressModeNetworking: + networkingIngress, err := ing.GetNetworkingIngress() + if err != nil { + t.Error(err) + } + checkIngressTLS(t, networkingIngress, hosts, secretNames) + case ingressutil.IngressModeExtensions: + extensionsIngress, err := ing.GetExtensionsIngress() + if err != nil { + t.Error(err) + } + checkTLSLegacy(t, extensionsIngress, hosts, secretNames) + } +} + +func checkIngressTLS(t *testing.T, ing *networkingv1.Ingress, hosts [][]string, secretNames []string) { + t.Helper() + assert.Equal(t, len(hosts), len(ing.Spec.TLS), "Count of TLS rules differs") + for it := 0; it < len(ing.Spec.TLS); it++ { + assert.Equal(t, secretNames[it], ing.Spec.TLS[it].SecretName, "Secret name differs") + assert.Equal(t, len(hosts[it]), len(ing.Spec.TLS[it].Hosts), "Count of hosts differs") + for ih := 0; ih < len(ing.Spec.TLS[it].Hosts); ih++ { + assert.Equal(t, hosts[it][ih], ing.Spec.TLS[it].Hosts[ih]) + } + } +} + +func checkTLSLegacy(t *testing.T, ing *extensionsv1beta1.Ingress, hosts [][]string, secretNames []string) { + t.Helper() + assert.Equal(t, len(hosts), len(ing.Spec.TLS), "Count of TLS rules differs") + for it := 0; it < len(ing.Spec.TLS); it++ { + assert.Equal(t, secretNames[it], ing.Spec.TLS[it].SecretName, "Secret name differs") + assert.Equal(t, len(hosts[it]), len(ing.Spec.TLS[it].Hosts), "Count of hosts differs") + for ih := 0; ih < len(ing.Spec.TLS[it].Hosts); ih++ { + assert.Equal(t, hosts[it][ih], ing.Spec.TLS[it].Hosts[ih]) + } + } +} + func TestCanaryIngressCreate(t *testing.T) { tests := generateMultiIngressTestData() for _, test := range tests { @@ -347,6 +389,112 @@ func TestCanaryIngressRetainIngressClass(t *testing.T) { } } +func TestCanaryIngressRetainTLS(t *testing.T) { + r := Reconciler{ + cfg: ReconcilerConfig{ + Rollout: fakeRollout("stable-service", "canary-service", "stable-ingress"), + }, + } + stable := networkingIngress("stable-ingress", 80, "stable-service") + stable.Spec.TLS = []networkingv1.IngressTLS{ + { + Hosts: []string{"fakehost.example.com"}, + SecretName: "tls-secret-name", + }, + { + Hosts: []string{"fakehost.example.com", "*.example.com"}, + SecretName: "tls-secret-name-two", + }, + } + stableIngress := ingressutil.NewIngress(stable) + + desiredCanaryIngress, err := r.canaryIngress(stableIngress, ingressutil.GetCanaryIngressName(r.cfg.Rollout), 15) + assert.Nil(t, err, "No error returned when calling canaryIngress") + + checkTLS(t, desiredCanaryIngress, [][]string{ + {"fakehost.example.com"}, + {"fakehost.example.com", "*.example.com"}, + }, []string{ + "tls-secret-name", + "tls-secret-name-two", + }) +} + +func TestCanaryIngressRetainLegacyTLS(t *testing.T) { + r := Reconciler{ + cfg: ReconcilerConfig{ + Rollout: fakeRollout("stable-service", "canary-service", "stable-ingress"), + }, + } + stable := extensionsIngress("stable-ingress", 80, "stable-service") + stable.Spec.TLS = []extensionsv1beta1.IngressTLS{ + { + Hosts: []string{"fakehost.example.com"}, + SecretName: "tls-secret-name", + }, + { + Hosts: []string{"fakehost.example.com", "*.example.com"}, + SecretName: "tls-secret-name-two", + }, + } + stableIngress := ingressutil.NewLegacyIngress(stable) + + desiredCanaryIngress, err := r.canaryIngress(stableIngress, ingressutil.GetCanaryIngressName(r.cfg.Rollout), 15) + assert.Nil(t, err, "No error returned when calling canaryIngress") + + checkTLS(t, desiredCanaryIngress, [][]string{ + {"fakehost.example.com"}, + {"fakehost.example.com", "*.example.com"}, + }, []string{ + "tls-secret-name", + "tls-secret-name-two", + }) +} + +func TestCanaryIngressNotAddTLS(t *testing.T) { + r := Reconciler{ + cfg: ReconcilerConfig{ + Rollout: fakeRollout("stable-service", "canary-service", "stable-ingress"), + }, + } + stable := networkingIngress("stable-ingress", 80, "stable-service") + + stableIngress := ingressutil.NewIngress(stable) + + desiredCanaryIngress, err := r.canaryIngress(stableIngress, ingressutil.GetCanaryIngressName(r.cfg.Rollout), 15) + assert.Nil(t, err, "No error returned when calling canaryIngress") + + desired, err := desiredCanaryIngress.GetNetworkingIngress() + + if err != nil { + t.Fatal(err) + } + + assert.Nil(t, desired.Spec.TLS, "No TLS in the the canary ingress should be present") +} + +func TestCanaryIngressNotAddLegacyTLS(t *testing.T) { + r := Reconciler{ + cfg: ReconcilerConfig{ + Rollout: fakeRollout("stable-service", "canary-service", "stable-ingress"), + }, + } + stable := extensionsIngress("stable-ingress", 80, "stable-service") + + stableIngress := ingressutil.NewLegacyIngress(stable) + + desiredCanaryIngress, err := r.canaryIngress(stableIngress, ingressutil.GetCanaryIngressName(r.cfg.Rollout), 15) + assert.Nil(t, err, "No error returned when calling canaryIngress") + + desired, err := desiredCanaryIngress.GetExtensionsIngress() + + if err != nil { + t.Fatal(err) + } + + assert.Nil(t, desired.Spec.TLS, "No TLS in the the canary ingress should be present") +} + func TestCanaryIngressAdditionalAnnotations(t *testing.T) { tests := generateMultiIngressTestData() for _, test := range tests { From 65065fcf5905c072d3ded28c7cc36fc4da5a5645 Mon Sep 17 00:00:00 2001 From: Pavels Fjodorovs Date: Fri, 24 Mar 2023 13:39:27 +0100 Subject: [PATCH 2/3] Retain TLS configuration for canary ingresses in the nginx integration Signed-off-by: Pavels Fjodorovs --- rollout/trafficrouting/nginx/nginx_test.go | 106 +++++++++++++++++++++ 1 file changed, 106 insertions(+) diff --git a/rollout/trafficrouting/nginx/nginx_test.go b/rollout/trafficrouting/nginx/nginx_test.go index 4d1d26ea98..fe2700b181 100644 --- a/rollout/trafficrouting/nginx/nginx_test.go +++ b/rollout/trafficrouting/nginx/nginx_test.go @@ -495,6 +495,112 @@ func TestCanaryIngressNotAddLegacyTLS(t *testing.T) { assert.Nil(t, desired.Spec.TLS, "No TLS in the the canary ingress should be present") } +func TestCanaryIngressRetainTLS(t *testing.T) { + r := Reconciler{ + cfg: ReconcilerConfig{ + Rollout: fakeRollout("stable-service", "canary-service", "stable-ingress"), + }, + } + stable := networkingIngress("stable-ingress", 80, "stable-service") + stable.Spec.TLS = []networkingv1.IngressTLS{ + { + Hosts: []string{"fakehost.example.com"}, + SecretName: "tls-secret-name", + }, + { + Hosts: []string{"fakehost.example.com", "*.example.com"}, + SecretName: "tls-secret-name-two", + }, + } + stableIngress := ingressutil.NewIngress(stable) + + desiredCanaryIngress, err := r.canaryIngress(stableIngress, ingressutil.GetCanaryIngressName(r.cfg.Rollout), 15) + assert.Nil(t, err, "No error returned when calling canaryIngress") + + checkTLS(t, desiredCanaryIngress, [][]string{ + {"fakehost.example.com"}, + {"fakehost.example.com", "*.example.com"}, + }, []string{ + "tls-secret-name", + "tls-secret-name-two", + }) +} + +func TestCanaryIngressRetainLegacyTLS(t *testing.T) { + r := Reconciler{ + cfg: ReconcilerConfig{ + Rollout: fakeRollout("stable-service", "canary-service", "stable-ingress"), + }, + } + stable := extensionsIngress("stable-ingress", 80, "stable-service") + stable.Spec.TLS = []extensionsv1beta1.IngressTLS{ + { + Hosts: []string{"fakehost.example.com"}, + SecretName: "tls-secret-name", + }, + { + Hosts: []string{"fakehost.example.com", "*.example.com"}, + SecretName: "tls-secret-name-two", + }, + } + stableIngress := ingressutil.NewLegacyIngress(stable) + + desiredCanaryIngress, err := r.canaryIngress(stableIngress, ingressutil.GetCanaryIngressName(r.cfg.Rollout), 15) + assert.Nil(t, err, "No error returned when calling canaryIngress") + + checkTLS(t, desiredCanaryIngress, [][]string{ + {"fakehost.example.com"}, + {"fakehost.example.com", "*.example.com"}, + }, []string{ + "tls-secret-name", + "tls-secret-name-two", + }) +} + +func TestCanaryIngressNotAddTLS(t *testing.T) { + r := Reconciler{ + cfg: ReconcilerConfig{ + Rollout: fakeRollout("stable-service", "canary-service", "stable-ingress"), + }, + } + stable := networkingIngress("stable-ingress", 80, "stable-service") + + stableIngress := ingressutil.NewIngress(stable) + + desiredCanaryIngress, err := r.canaryIngress(stableIngress, ingressutil.GetCanaryIngressName(r.cfg.Rollout), 15) + assert.Nil(t, err, "No error returned when calling canaryIngress") + + desired, err := desiredCanaryIngress.GetNetworkingIngress() + + if err != nil { + t.Fatal(err) + } + + assert.Nil(t, desired.Spec.TLS, "No TLS in the the canary ingress should be present") +} + +func TestCanaryIngressNotAddLegacyTLS(t *testing.T) { + r := Reconciler{ + cfg: ReconcilerConfig{ + Rollout: fakeRollout("stable-service", "canary-service", "stable-ingress"), + }, + } + stable := extensionsIngress("stable-ingress", 80, "stable-service") + + stableIngress := ingressutil.NewLegacyIngress(stable) + + desiredCanaryIngress, err := r.canaryIngress(stableIngress, ingressutil.GetCanaryIngressName(r.cfg.Rollout), 15) + assert.Nil(t, err, "No error returned when calling canaryIngress") + + desired, err := desiredCanaryIngress.GetExtensionsIngress() + + if err != nil { + t.Fatal(err) + } + + assert.Nil(t, desired.Spec.TLS, "No TLS in the the canary ingress should be present") +} + func TestCanaryIngressAdditionalAnnotations(t *testing.T) { tests := generateMultiIngressTestData() for _, test := range tests { From 941840d806e9c8b116208f9bdb9ef784303aa4c4 Mon Sep 17 00:00:00 2001 From: Pavels Fjodorovs Date: Thu, 30 Mar 2023 09:16:45 +0200 Subject: [PATCH 3/3] fixed tests after multiple nginx ingress merge Signed-off-by: Pavels Fjodorovs --- rollout/trafficrouting/nginx/nginx_test.go | 121 ++++++--------------- 1 file changed, 31 insertions(+), 90 deletions(-) diff --git a/rollout/trafficrouting/nginx/nginx_test.go b/rollout/trafficrouting/nginx/nginx_test.go index fe2700b181..6930ce1e06 100644 --- a/rollout/trafficrouting/nginx/nginx_test.go +++ b/rollout/trafficrouting/nginx/nginx_test.go @@ -392,10 +392,10 @@ func TestCanaryIngressRetainIngressClass(t *testing.T) { func TestCanaryIngressRetainTLS(t *testing.T) { r := Reconciler{ cfg: ReconcilerConfig{ - Rollout: fakeRollout("stable-service", "canary-service", "stable-ingress"), + Rollout: fakeRollout(stableService, canaryService, StableIngress, nil), }, } - stable := networkingIngress("stable-ingress", 80, "stable-service") + stable := networkingIngress(StableIngress, 80, stableService) stable.Spec.TLS = []networkingv1.IngressTLS{ { Hosts: []string{"fakehost.example.com"}, @@ -408,7 +408,7 @@ func TestCanaryIngressRetainTLS(t *testing.T) { } stableIngress := ingressutil.NewIngress(stable) - desiredCanaryIngress, err := r.canaryIngress(stableIngress, ingressutil.GetCanaryIngressName(r.cfg.Rollout), 15) + desiredCanaryIngress, err := r.canaryIngress(stableIngress, ingressutil.GetCanaryIngressName(r.cfg.Rollout.GetName(), StableIngress), 15) assert.Nil(t, err, "No error returned when calling canaryIngress") checkTLS(t, desiredCanaryIngress, [][]string{ @@ -420,119 +420,60 @@ func TestCanaryIngressRetainTLS(t *testing.T) { }) } -func TestCanaryIngressRetainLegacyTLS(t *testing.T) { +func TestCanaryIngressRetainTLSWithMultipleStableIngresses(t *testing.T) { r := Reconciler{ cfg: ReconcilerConfig{ - Rollout: fakeRollout("stable-service", "canary-service", "stable-ingress"), + Rollout: fakeRollout(stableService, canaryService, StableIngress, []string{StableIngresses}), }, } - stable := extensionsIngress("stable-ingress", 80, "stable-service") - stable.Spec.TLS = []extensionsv1beta1.IngressTLS{ + + // main + stable := networkingIngress(StableIngress, 80, stableService) + stable.Spec.TLS = []networkingv1.IngressTLS{ { Hosts: []string{"fakehost.example.com"}, SecretName: "tls-secret-name", }, - { - Hosts: []string{"fakehost.example.com", "*.example.com"}, - SecretName: "tls-secret-name-two", - }, } - stableIngress := ingressutil.NewLegacyIngress(stable) + stableIngress := ingressutil.NewIngress(stable) - desiredCanaryIngress, err := r.canaryIngress(stableIngress, ingressutil.GetCanaryIngressName(r.cfg.Rollout), 15) + desiredCanaryIngress, err := r.canaryIngress(stableIngress, ingressutil.GetCanaryIngressName(r.cfg.Rollout.GetName(), StableIngress), 15) assert.Nil(t, err, "No error returned when calling canaryIngress") checkTLS(t, desiredCanaryIngress, [][]string{ {"fakehost.example.com"}, - {"fakehost.example.com", "*.example.com"}, }, []string{ "tls-secret-name", - "tls-secret-name-two", }) -} - -func TestCanaryIngressNotAddTLS(t *testing.T) { - r := Reconciler{ - cfg: ReconcilerConfig{ - Rollout: fakeRollout("stable-service", "canary-service", "stable-ingress"), - }, - } - stable := networkingIngress("stable-ingress", 80, "stable-service") - - stableIngress := ingressutil.NewIngress(stable) - - desiredCanaryIngress, err := r.canaryIngress(stableIngress, ingressutil.GetCanaryIngressName(r.cfg.Rollout), 15) - assert.Nil(t, err, "No error returned when calling canaryIngress") - - desired, err := desiredCanaryIngress.GetNetworkingIngress() - - if err != nil { - t.Fatal(err) - } - - assert.Nil(t, desired.Spec.TLS, "No TLS in the the canary ingress should be present") -} - -func TestCanaryIngressNotAddLegacyTLS(t *testing.T) { - r := Reconciler{ - cfg: ReconcilerConfig{ - Rollout: fakeRollout("stable-service", "canary-service", "stable-ingress"), - }, - } - stable := extensionsIngress("stable-ingress", 80, "stable-service") - - stableIngress := ingressutil.NewLegacyIngress(stable) - - desiredCanaryIngress, err := r.canaryIngress(stableIngress, ingressutil.GetCanaryIngressName(r.cfg.Rollout), 15) - assert.Nil(t, err, "No error returned when calling canaryIngress") - - desired, err := desiredCanaryIngress.GetExtensionsIngress() - if err != nil { - t.Fatal(err) - } - - assert.Nil(t, desired.Spec.TLS, "No TLS in the the canary ingress should be present") -} - -func TestCanaryIngressRetainTLS(t *testing.T) { - r := Reconciler{ - cfg: ReconcilerConfig{ - Rollout: fakeRollout("stable-service", "canary-service", "stable-ingress"), - }, - } - stable := networkingIngress("stable-ingress", 80, "stable-service") - stable.Spec.TLS = []networkingv1.IngressTLS{ + // additional + stableAdditional := networkingIngress(StableIngresses, 80, stableService) + stableAdditional.Spec.TLS = []networkingv1.IngressTLS{ { - Hosts: []string{"fakehost.example.com"}, - SecretName: "tls-secret-name", - }, - { - Hosts: []string{"fakehost.example.com", "*.example.com"}, - SecretName: "tls-secret-name-two", + Hosts: []string{"fakehost-additional.example.com"}, + SecretName: "tls-secret-name-additional", }, } - stableIngress := ingressutil.NewIngress(stable) + stableAdditionalIngress := ingressutil.NewIngress(stableAdditional) - desiredCanaryIngress, err := r.canaryIngress(stableIngress, ingressutil.GetCanaryIngressName(r.cfg.Rollout), 15) + desiredAdditionalCanaryIngress, err := r.canaryIngress(stableAdditionalIngress, ingressutil.GetCanaryIngressName(r.cfg.Rollout.GetName(), StableIngresses), 15) assert.Nil(t, err, "No error returned when calling canaryIngress") - checkTLS(t, desiredCanaryIngress, [][]string{ - {"fakehost.example.com"}, - {"fakehost.example.com", "*.example.com"}, + checkTLS(t, desiredAdditionalCanaryIngress, [][]string{ + {"fakehost-additional.example.com"}, }, []string{ - "tls-secret-name", - "tls-secret-name-two", + "tls-secret-name-additional", }) + } func TestCanaryIngressRetainLegacyTLS(t *testing.T) { r := Reconciler{ cfg: ReconcilerConfig{ - Rollout: fakeRollout("stable-service", "canary-service", "stable-ingress"), + Rollout: fakeRollout(stableService, canaryService, StableIngress, nil), }, } - stable := extensionsIngress("stable-ingress", 80, "stable-service") + stable := extensionsIngress(StableIngress, 80, stableService) stable.Spec.TLS = []extensionsv1beta1.IngressTLS{ { Hosts: []string{"fakehost.example.com"}, @@ -545,7 +486,7 @@ func TestCanaryIngressRetainLegacyTLS(t *testing.T) { } stableIngress := ingressutil.NewLegacyIngress(stable) - desiredCanaryIngress, err := r.canaryIngress(stableIngress, ingressutil.GetCanaryIngressName(r.cfg.Rollout), 15) + desiredCanaryIngress, err := r.canaryIngress(stableIngress, ingressutil.GetCanaryIngressName(r.cfg.Rollout.GetName(), StableIngress), 15) assert.Nil(t, err, "No error returned when calling canaryIngress") checkTLS(t, desiredCanaryIngress, [][]string{ @@ -560,14 +501,14 @@ func TestCanaryIngressRetainLegacyTLS(t *testing.T) { func TestCanaryIngressNotAddTLS(t *testing.T) { r := Reconciler{ cfg: ReconcilerConfig{ - Rollout: fakeRollout("stable-service", "canary-service", "stable-ingress"), + Rollout: fakeRollout(stableService, canaryService, StableIngress, nil), }, } - stable := networkingIngress("stable-ingress", 80, "stable-service") + stable := networkingIngress(StableIngress, 80, stableService) stableIngress := ingressutil.NewIngress(stable) - desiredCanaryIngress, err := r.canaryIngress(stableIngress, ingressutil.GetCanaryIngressName(r.cfg.Rollout), 15) + desiredCanaryIngress, err := r.canaryIngress(stableIngress, ingressutil.GetCanaryIngressName(r.cfg.Rollout.GetName(), StableIngress), 15) assert.Nil(t, err, "No error returned when calling canaryIngress") desired, err := desiredCanaryIngress.GetNetworkingIngress() @@ -582,14 +523,14 @@ func TestCanaryIngressNotAddTLS(t *testing.T) { func TestCanaryIngressNotAddLegacyTLS(t *testing.T) { r := Reconciler{ cfg: ReconcilerConfig{ - Rollout: fakeRollout("stable-service", "canary-service", "stable-ingress"), + Rollout: fakeRollout(stableService, canaryService, StableIngress, nil), }, } - stable := extensionsIngress("stable-ingress", 80, "stable-service") + stable := extensionsIngress(StableIngress, 80, stableService) stableIngress := ingressutil.NewLegacyIngress(stable) - desiredCanaryIngress, err := r.canaryIngress(stableIngress, ingressutil.GetCanaryIngressName(r.cfg.Rollout), 15) + desiredCanaryIngress, err := r.canaryIngress(stableIngress, ingressutil.GetCanaryIngressName(r.cfg.Rollout.GetName(), StableIngress), 15) assert.Nil(t, err, "No error returned when calling canaryIngress") desired, err := desiredCanaryIngress.GetExtensionsIngress()