-
Notifications
You must be signed in to change notification settings - Fork 269
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
auth-url does not handle well service with port names instead of numbers #981
Comments
As an additional piece of this, it took a long time to debug what was happening due to the silent error catch in haproxy-ingress/pkg/converters/ingress/annotations/backend.go Lines 184 to 187 in 4862b87
The buildID function haproxy-ingress/pkg/haproxy/types/backends.go Lines 331 to 333 in 4862b87
|
Hi, thanks for the detailed description and digging into the code. You folks are 💯! Port names are normalizes to create backends, so two distinct references that point to the same backend will end up with the same backend name. This however doesn't happen in the annotation parsing, the port name is copied verbatim from the auth external url, which should be different from the way the backend was created if the container uses named port. I just created #982 trying to circumvent that behavior, adding log and a few more documentation. There is a proper way to fix that, creating the backend in the annotation parsing, but this needs a small refactor in the code. Please let me know if the changes in the PR sounds good to you all, since you faced the issue and found a work around. This issue will be left open until the refactor is made and merged. |
Description of the problem
Assume a service with the following manifest (snippet):
the corresponding deployment has the following port definition:
if an ingress is configured as follows (the documentation says to use port number):
it will silently fail (no error logged anywhere) and always deny all requests
Expected behaviour
Either an error is logged to warn that the backend could not be found or the code always converts ports to port number so it works in both cases.
What works is haproxy-ingress.github.io/auth-url: svc://my-authentication:authentication/api/v2/auth
So an alternate (quick) solution is to update the doc and specify that the port should match the targetPort value in the service.
Steps to reproduce the problem
Environment information
HAProxy Ingress version:
v0.14.0
The text was updated successfully, but these errors were encountered: