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

wildcard hostnames produce invalid regex for Host predicate #3297

Open
MustafaSaber opened this issue Nov 1, 2024 · 1 comment · May be fixed by #3296
Open

wildcard hostnames produce invalid regex for Host predicate #3297

MustafaSaber opened this issue Nov 1, 2024 · 1 comment · May be fixed by #3296
Labels

Comments

@MustafaSaber
Copy link
Member

Describe the bug
converting host from Ingress/RouteGroup for Host predicate doesn't take into consideration that Ingress support wildcard hostnames (see https://kubernetes.io/docs/concepts/services-networking/ingress/#hostname-wildcards) and we produce invalid regex

Error:

[APP]time="2024-11-01T12:43:46Z" level=error msg="kube_default__simple_redirect_app_default_0____example_org_____ [2]: error parsing regexp: missing argument to repetition operator: *

To Reproduce

create ingress with wildcard hostname

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: simple
  labels:
    name: simple
spec:
  rules:
  - host: "*.example.org"
    http:
      paths:
      - pathType: Prefix
        path: "/"
        backend:
          service:
            name: simple
            port: 
              number: 80

Reproducer PR #3296

Expected behavior

Valid regex generated and routingTable updated with the new entries

Observed behavior

Not valid regex is created and ingress routes are ignored.

for this ingress ^(*[.]example[.]org[.]?(:[0-9]+)?)$

@MustafaSaber MustafaSaber linked a pull request Nov 1, 2024 that will close this issue
@MustafaSaber
Copy link
Member Author

This can cause concerns about operational safety so we can also just

  • Document the behaviour
  • Block at validation webhook level instead of skipper level for more visibility

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant