Fix panic on multiple non-matching canary

This commit is contained in:
Per Bernhardt 2019-03-04 11:20:54 +00:00 committed by Per Bernhardt
parent 79c52cf094
commit 8a40e82ffb
3 changed files with 56 additions and 1 deletions

View file

@ -758,4 +758,28 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
})
})
})
Context("Single canary Ingress with multiple paths to same backend", func() {
It("should work", func() {
host := "foo"
canaryIngName := fmt.Sprintf("%v-canary", host)
annotations := map[string]string{
"nginx.ingress.kubernetes.io/canary": "true",
"nginx.ingress.kubernetes.io/canary-by-header": "CanaryByHeader",
}
paths := []string{"/foo", "/bar"}
ing := framework.NewSingleIngressWithMultiplePaths(canaryIngName, paths, host, f.Namespace, "httpy-svc-canary", 80, &annotations)
f.EnsureIngress(ing)
ing = framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, nil)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
func(server string) bool {
return Expect(server).Should(ContainSubstring("server_name foo"))
})
})
})
})