Skip to content
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

ProhibitedTargets has incorrect path requirement #1605

Open
scriptkiddie123 opened this issue Apr 4, 2024 · 1 comment
Open

ProhibitedTargets has incorrect path requirement #1605

scriptkiddie123 opened this issue Apr 4, 2024 · 1 comment

Comments

@scriptkiddie123
Copy link

Describe the bug
ProhibitedTargets require the path to end with "/*" as described here:
(https://github.com/Azure/application-gateway-kubernetes-ingress/blob/master/crds/AzureIngressProhibitedTarget-v1-CRD-v1.yaml#L28)
However when checking in the Azure Application Gateway rules, then paths just have to start with "/", so of you have a rule for a single path, like /index.html, then you can't set that as a AzureIngressProhibitedTarget.

To Reproduce
Asuming you have a working values file for you AGIC helmchart deployment, add the following, to activate a prohibited target:
`appgw:
shared: true
prohibitedTargets:

  • name: prohibit
    hostname: www.mycompany.com
    paths:
    • /index.html
      This will give a deployment error like:AzureIngressProhibitedTarget.appgw.ingress.k8s.io "prohibit" is invalid: [spec.paths[0]: Invalid value: "/index.html": spec.paths[0] in body should match '^/(?:.+/)?*$'`

Ingress Controller details

  • Output of kubectl describe pod <ingress controller> . The pod name can be obtained by running helm list.
  • Output of `kubectl logs .
  • Any Azure support tickets associated with this issue.

** additional notes**
I am considering just modifying the CRD yaml so it supports basically anything that starts with /, but I am wondering if there are other contraints in the AGIC code?

@scriptkiddie123
Copy link
Author

scriptkiddie123 commented Apr 4, 2024

I have changed this part directly in my cluster:
paths:
description: >-
(optional) A list of URL paths, for which the Ingress
Controller is prohibited from mutating Application Gateway
configuration; Must begin with a / and end with /*
type: array
items:
type: string
pattern: ^/(?:.+)?
I am now able to add /index.html without any problems. I did some changes to the my ingress resource, and it did not break any of the prohibited targets, so that solution seems to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant