Annotation validation breaks x-forwarded-prefix
annotation
#10597
Labels
kind/bug
Categorizes issue or PR as related to a bug.
needs-priority
needs-triage
Indicates an issue or PR lacks a `triage/foo` label and requires one.
What happened:
When we enable annotation validation our Ingress resources fail due to this annotation:
What you expected to happen:
No validation errors.
NGINX Ingress controller version (exec into the pod and run nginx-ingress-controller --version.):
NGINX Ingress controller
Release: v1.9.4
Build: 846d251
Repository: https://github.com/kubernetes/ingress-nginx
nginx version: nginx/1.21.6
Kubernetes version (use
kubectl version
):Client Version: version.Info{Major:"1", Minor:"27", GitVersion:"v1.27.7", GitCommit:"07a61d861519c45ef5c89bc22dda289328f29343", GitTreeState:"clean", BuildDate:"2023-10-18T11:42:32Z", GoVersion:"go1.20.10", Compiler:"gc", Platform:"linux/amd64"}
Kustomize Version: v5.0.1
Server Version: version.Info{Major:"1", Minor:"27+", GitVersion:"v1.27.6-eks-f8587cb", GitCommit:"b6911bf9eade7d8ca7dd82af5e80626965829947", GitTreeState:"clean", BuildDate:"2023-09-18T22:12:19Z", GoVersion:"go1.20.8", Compiler:"gc", Platform:"linux/amd64"}
Environment:
Cloud provider or hardware configuration: EKS
How was the ingress-nginx-controller installed: ArgoCD/Helm
How to reproduce this issue:
With annotation validation enabled, try adding the following annotation to an Ingress:
Anything else we need to know:
Our Ingress resources often tend to have these annotations in tandem:
The rewrite-target annotation is accepted, but not the x-forwarded-prefix. Comparing:
ingress-nginx/internal/ingress/annotations/rewrite/main.go
Lines 42 to 48 in cf156c7
ingress-nginx/internal/ingress/annotations/xforwardedprefix/main.go
Lines 33 to 38 in cf156c7
Using
parser.RegexPathWithCapture
instead ofparser.BasicCharsRegex
for x-forwarded-prefix would probably fix it.The text was updated successfully, but these errors were encountered: