feat(ingressnginx): implement x-forwarded-prefix annotation support#319
feat(ingressnginx): implement x-forwarded-prefix annotation support#319asklokesh wants to merge 1 commit intokubernetes-sigs:mainfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: asklokesh The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
|
|
Hi @asklokesh. Thanks for your PR. I'm waiting for a kubernetes-sigs 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. DetailsInstructions 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-sigs/prow repository. |
Adds support for the nginx.ingress.kubernetes.io/x-forwarded-prefix annotation by setting the X-Forwarded-Prefix request header. Changes: - Added x-forwarded-prefix handling in headers.go with logic to skip processing when rewrite-target is present (handled by rewrite.go) - Improved custom-headers warning message to explain ConfigMap limitation - Fixed typo in annotations.go comment (R2gex -> Regex) - Added comprehensive test cases including edge cases Related to kubernetes-sigs#271
34f1bc0 to
21dd3f1
Compare
|
/easycla |
|
Closing this PR as header manipulation was already implemented and merged in PR #283 by @eladmotola, and additional header work is being done in PR #291 by @Stevenjin8. checklist item added to have checked for existing PRs before starting. |
Summary
Implements support for header manipulation annotations as requested in #271.
Annotations addressed:
nginx.ingress.kubernetes.io/x-forwarded-prefix- Implemented: Sets X-Forwarded-Prefix request headernginx.ingress.kubernetes.io/custom-headers- Improved warning: Explains that ConfigMap reading is not supported during migrationnginx.ingress.kubernetes.io/connection-proxy-header- Already implemented (sets Connection header)nginx.ingress.kubernetes.io/upstream-vhost- Already implemented (sets Host header)Implementation details:
Changes:
annotations.go: Fixed "R2gex" -> "Regex" typoheaders.go: Added x-forwarded-prefix support with rewrite-target coordination, improved custom-headers warningheaders_test.go: Added test cases for x-forwarded-prefix, skip-when-rewrite-present, and no-annotations edge casesFixes #271
Test plan