Open
Description
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]+)?)$