Skip to content

Conversation

SF97
Copy link
Contributor

@SF97 SF97 commented Sep 18, 2025

When an Ingress resource used a wildcard host (e.g., *.example.com) in combination with the haproxy.org/route-acl service annotation, the controller would generate an incorrect HAProxy ACL. It used an exact string match (-m str) on the literal value *.example.com, which would fail to match any intended subdomains.

This patch modifies the route generation logic to inspect the hostname. If the host begins with an asterisk ('*'), it now correctly generates an ACL using a suffix match (-m end) and removes the leading asterisk from the hostname string.

For non-wildcard hosts, the original behavior of using an exact string match (-m str) is preserved.

Fixes: #734

@SF97
Copy link
Contributor Author

SF97 commented Sep 18, 2025

Would love to have this reviewed @oktalz :)

This would help us a lot, it's blocking a release on our side, and it benefits all HAProxy users with the same use case

@SF97 SF97 force-pushed the master branch 3 times, most recently from ae555e5 to 3589039 Compare September 25, 2025 08:57
When an Ingress resource used a wildcard host (e.g., `*.example.com`)
in combination with the `haproxy.org/route-acl` service annotation,
the controller would generate an incorrect HAProxy ACL. It used an
exact string match (`-m str`) on the literal value `*.example.com`,
which would fail to match any intended subdomains.

This patch modifies the route generation logic to inspect the hostname.
If the host begins with an asterisk ('*'), it now correctly generates an
ACL using a suffix match (`-m end`) and removes the leading asterisk
from the hostname string.

For non-wildcard hosts, the original behavior of using an exact string
match (`-m str`) is preserved.

Fixes: haproxytech#734
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 this pull request may close these issues.

Subdomain wildcard does not work together with route-acl service annotation

1 participant