-
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
[ingress/controllers/nginx] Add whitelistSourceRange of global config to location block in template #312
[ingress/controllers/nginx] Add whitelistSourceRange of global config to location block in template #312
Conversation
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://github.com/kubernetes/kubernetes/wiki/CLA-FAQ to sign the CLA. Once you've signed, please reply here (e.g. "I signed it!") and we'll verify. Thanks.
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. I understand the commands that are listed here. |
I signed it! |
The idea is to omit the value in the configmap if you use the annotation. |
@aledbf That's what my PR should do. If an annotation is set on the ingress, it doesn't set the global one for that location block. To be clear: the global whitelist wasn't taken into account, ever. |
@aledbf That's only parsing of the annotation on the Ingress, where happens the parsing/processing of the global |
@bviolier line 60 and 66, if there is no annotation, it returns the value from the configmap. |
You are right, my bad. But, it doesn't seem to work in the latest Nginx controller beta though (nginx-ingress-controller:0.9.0-beta.1). With my PR it did work for me. |
@bviolier please open an issue to fix it. |
Issue has been reported as #473. |
The current nginx.tmpl only takes into account
ingress.kubernetes.io/whitelist-source-range
set on an Ingress but doesn't seem to take into accountwhitelist-source-range
set in the Configmap of Nginx.According to the docs at https://github.com/kubernetes/ingress/blob/master/controllers/nginx/configuration.md it should take that into account though:
This pull request add's the
whitelist-source-range
information to nginx.tmpl, only if for the location no specific one is set.