You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's assume we have a web service with prefix /foo. There are many sub-paths for /foo/.... Let's also assume we want to have different timeouts for /foo and /foo/.*.
The annotation haproxy.org/standalone-backendensures two separate backends are created so that the different timeouts do not fight each other.
Now we have the problem that /etc/haproxy/maps/path-exact.map has the following contents:
That means the actual exact match from ingress just-foo will never match since pathType Prefix patterns are also put into this pattern file. Here we can find the responsible code:
I do understand why Prefix paths must have an entry in path-exact.map: The definition of ingress resources mandates that /foo must match /foo and /foo/bar but never /foobar. Therefore we add /foo to exact matches and /foo/ to prefix matches (via map_beg).
The only way I see to resolve this issue in a clean and backward-compatible way is to introduce a new map file which will contain all exact matches from pathType Prefix only and it will be matched if there was no match in path-exact.map which will then contain ONLY pathType Exact patterns.
I will follow up with a PR.
The text was updated successfully, but these errors were encountered:
Hi @dosmanak, if an ingress controller wants to implement regex-based parsing then pathType ImplementationSpecfic is the way to go. But this is beside the point of this issue. Here I discussed that prefix paths can sometimes override exact paths, which should not happen.
If you would like to discuss regex-based path matching feel free to open another issue for that. I am not a maintainer of this project, but I certainly can contribute some caveats to be aware of.
Let's assume we have a web service with prefix
/foo
. There are many sub-paths for/foo/...
. Let's also assume we want to have different timeouts for/foo
and/foo/.*
.We would expect the following to work:
The annotation
haproxy.org/standalone-backend
ensures two separate backends are created so that the different timeouts do not fight each other.Now we have the problem that
/etc/haproxy/maps/path-exact.map
has the following contents:That means the actual exact match from ingress
just-foo
will never match since pathTypePrefix
patterns are also put into this pattern file.Here we can find the responsible code:
I do understand why
Prefix
paths must have an entry inpath-exact.map
: The definition of ingress resources mandates that/foo
must match/foo
and/foo/bar
but never/foobar
. Therefore we add/foo
to exact matches and/foo/
to prefix matches (viamap_beg
).The only way I see to resolve this issue in a clean and backward-compatible way is to introduce a new map file which will contain all exact matches from pathType
Prefix
only and it will be matched if there was no match inpath-exact.map
which will then contain ONLY pathTypeExact
patterns.I will follow up with a PR.
The text was updated successfully, but these errors were encountered: