-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix panic on multiple non-matching canary #3839
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What about
without I'd implement this as a unit test, but not feeling strongly. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just tried to keep up with the structure of the rest of the file. I can remove the Context if preferred. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
yes, please There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
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")) | ||
}) | ||
}) | ||
}) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this really an error? Maybe warn here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just tell me. I can change it in a bit!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's make it a warning and fix the typo in the message:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done