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

HTTPProxy: some routes are ignored when they differ only on header condition operator or value #2597

Closed
skriss opened this issue Jun 17, 2020 · 1 comment · Fixed by #2600

Comments

@skriss
Copy link
Member

skriss commented Jun 17, 2020

What steps did you take and what happened:
Define an HTTPProxy with several routes that all have the same prefix and all have a condition on the same header, but different operators or values (some examples below).

Observe that Envoy is only configured with the last route; the other ones are dropped.

# two routes that both have a 'contains' condition on the
# same header, with two different values.
apiVersion: projectcontour.io/v1
kind: HTTPProxy
metadata:
  name: dropped-routes-1
spec:
  virtualhost:
    fqdn: stevek.com
  routes:
    - conditions:
        - header:
            name: x-stevek
            contains: foo
      services:
        - name: svc1
          port: 80
    - conditions:
        - header:
            name: x-stevek
            contains: bar
      services:
        - name: svc2
          port: 80
---
# two routes that both have a condition on the
# same header -- one using 'contains' and one
# using 'notcontains'.
apiVersion: projectcontour.io/v1
kind: HTTPProxy
metadata:
  name: dropped-routes
spec:
  virtualhost:
    fqdn: stevek.com
  routes:
    - conditions:
        - header:
            name: x-stevek
            contains: foo
      services:
        - name: svc1
          port: 80
    - conditions:
        - header:
            name: x-stevek
            notcontains: foo
      services:
        - name: svc2
          port: 80

What did you expect to happen:
All of the routes to be configured with Envoy.

@skriss
Copy link
Member Author

skriss commented Jun 17, 2020

Looks like this is caused by this HeaderCondition method, which is used as part of a map key in this code.

I'm working on a fix + tests.

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

Successfully merging a pull request may close this issue.

1 participant