application-gateway-kubernetes-ingress icon indicating copy to clipboard operation
application-gateway-kubernetes-ingress copied to clipboard

ProhibitedTargets has incorrect path requirement

Open scriptkiddie123 opened this issue 1 year ago • 1 comments

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 avatar Apr 04 '24 10:04 scriptkiddie123

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.

scriptkiddie123 avatar Apr 04 '24 12:04 scriptkiddie123