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

Support regex with "?!" in HTTPProxy #6746

Open
jadefr opened this issue Oct 29, 2024 · 3 comments
Open

Support regex with "?!" in HTTPProxy #6746

jadefr opened this issue Oct 29, 2024 · 3 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/needs-triage Indicates that an issue needs to be triaged by a project contributor. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Comments

@jadefr
Copy link

jadefr commented Oct 29, 2024

I get the following error when creating HTTPProxy with "?!":

  - errors:
    - message: 'route: supplied regex: /lorem/(?!.*\/ipsum)(.*) invalid. error: error
        parsing regexp: invalid or unsupported Perl syntax: `(?!`'
      reason: PathMatchConditionsNotValid
      status: "True"
      type: RouteError

Steps to reproduce:

Deploy yaml:

apiVersion: projectcontour.io/v1
kind: HTTPProxy
metadata:
  name: basic
spec:
  virtualhost:
    fqdn: foo-basic.bar.com
  routes:
    - conditions:
      - regex: /lorem/(?!.*\/ipsum)(.*)
      services:
        - name: s1
          port: 80

I believe using package regexp2 would solve the issue.
As an example, the following PR was done in NGINX Virtual Server: nginxinc/kubernetes-ingress#4465

@jadefr jadefr added kind/feature Categorizes issue or PR as related to a new feature. lifecycle/needs-triage Indicates that an issue needs to be triaged by a project contributor. labels Oct 29, 2024
Copy link

Hey @jadefr! Thanks for opening your first issue. We appreciate your contribution and welcome you to our community! We are glad to have you here and to have your input on Contour. You can also join us on our mailing list and in our channel in the Kubernetes Slack Workspace

@tsaarni
Copy link
Member

tsaarni commented Oct 29, 2024

Hi @jadefr. the validation Contour does using Go’s regexpshould align with Google’s RE2 engine as used in Envoy. It appears that NGINX uses PCRE, which does support negative lookaheads.

Copy link

github-actions bot commented Jan 9, 2025

The Contour project currently lacks enough contributors to adequately respond to all Issues.

This bot triages Issues according to the following rules:

  • After 60d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, the Issue is closed

You can:

  • Mark this Issue as fresh by commenting
  • Close this Issue
  • Offer to help out with triage

Please send feedback to the #contour channel in the Kubernetes Slack

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/needs-triage Indicates that an issue needs to be triaged by a project contributor. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
None yet
Development

No branches or pull requests

2 participants