Azure / application-gateway-kubernetes-ingress

This is an ingress controller that can be run on Azure Kubernetes Service (AKS) to allow an Azure Application Gateway to act as the ingress for an AKS cluster.
https://azure.github.io/application-gateway-kubernetes-ingress
MIT License
673 stars 419 forks source link

Not setting modifiedQueryString still results in a rewrite rule that sets the query string to empty #1648

Open cristicalin opened 1 week ago

cristicalin commented 1 week ago

Describe the bug We are using rewrite rules on ingress to rewrite paths but would like to preserve the query string. The AppGW ingress controller updates the rewrite rule to update both URL and query string always.

To Reproduce

apiVersion: appgw.ingress.azure.io/v1beta1
kind: AzureApplicationGatewayRewrite
metadata:
  name: test
  namespace: dev
spec:
  rewriteRules:
    - actions:
        urlConfiguration:
          modifiedPath: /api/v{var_uri_path_1}/{var_uri_path_2}
          reroute: false
      conditions:
        - ignoreCase: false
          negate: false
          pattern: /api/v([0-9]+)/r/(.*)
          variable: var_uri_path
      name: test
      ruleSequence: 1

This should set the Components to URL path but it results in setting it to Both URL path and URL query string. Expected outcome: image

Actual outcome: image

This breaks our application's rewrite logic.

Ingress Controller details

cristicalin commented 1 week ago

Found a workaround for this, I can set the modifiedQueryString: '{var_query_string}' and that keeps the original query string