-
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 duplicate location in NGINX config (#10090) #10091
base: main
Are you sure you want to change the base?
Conversation
|
Welcome @ailurarctos! |
Hi @ailurarctos. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@ailurarctos thanks for the contribution. I see this in the related issue
Can you clarify ,if this protection from duplication PR, is assuming that the admission webhook is deleted. |
Yes. I put more details in #10090 (comment). |
/ok-to-test |
/assign |
Sorry for the delay. |
@tao12345666333 sorry, did you have a chance to review this pr? |
When creating ingresses that use the same path with a mix of Exact and Prefix path types nginx-ingress-controller can generate an NGINX config with a duplicate location: nginx: [emerg] duplicate location "/a/" in /tmp/nginx/nginx-cfg2287376726:693 nginx: configuration file /tmp/nginx/nginx-cfg2287376726 test failed The issue is that nginx-ingress-controller stops looking for duplicates once it sees the same path with a different path type.
✅ Deploy Preview for kubernetes-ingress-nginx canceled.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: ailurarctos The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Spec: networking.IngressSpec{ | ||
Rules: []networking.IngressRule{ | ||
{ | ||
Host: "example.com", |
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.
Should I make a const
for this as the linter suggests? It doesn't seem to match the way the existing tests are written.
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.
yes please, let's make linter happy
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.
Also please add an e2e test case for this one
I will approve it after that, just ping me on slack
When creating ingresses that use the same path with a mix of
Exact
andPrefix
path types nginx-ingress-controller can generate an NGINX config with a duplicate location:The issue is that nginx-ingress-controller stops looking for duplicates once it sees the same path with a different path type.
What this PR does / why we need it:
This is a PR to fix #10090.
Types of changes
Which issue/s this PR fixes
fixes #10090
How Has This Been Tested?
I added a test for the change. I also ran all tests in https://github.com/kubernetes/ingress-nginx/blob/main/docs/developer-guide/getting-started.md#testing.
Checklist: