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

Header based routing does not work if original HTTP route has filters on it #87

Open
kostis-codefresh opened this issue Oct 7, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@kostis-codefresh
Copy link
Collaborator

The header based routing example only works if the existing HTTP route has no filters.

This works

apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: my-smart-route
spec:
  parentRefs:
    - name: traefik-gateway
      namespace: default
  rules:
  - matches:
    - path:
        type: PathPrefix
        value: /     
    backendRefs:
     - name: argo-rollouts-stable-service
       kind: Service
       port: 80
     - name: argo-rollouts-canary-service
       kind: Service
       port: 80

This does not work

apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: my-smart-route
spec:
  parentRefs:
    - name: traefik-gateway
      namespace: default
  rules:
  - matches:
    - path:
        type: PathPrefix  
        value: /smart/ 
     filters:
       - type: URLRewrite
         urlRewrite:
           path:
             type: ReplacePrefixMatch
             replacePrefixMatch: / 
    backendRefs:
     - name: argo-rollouts-stable-service
       kind: Service
       port: 80
     - name: argo-rollouts-canary-service
       kind: Service
       port: 80

Full example is here.

When a header based http route is created it should copy all the properties from the original route (including filters)


Message from the maintainers:

Impacted by this bug? Give it a 👍. We prioritize the issues with the most 👍.

@kostis-codefresh kostis-codefresh added the bug Something isn't working label Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants