Repository navigation
Commit 92d3fa1
committed
fix: add trailing slash to gateway name prefix check in CTP port overlap validation
When mergeGateways is enabled and two Gateways exist where one name is a string prefix of the other (e.g. 'gw' and 'gw-b'), a Gateway-wide ClientTrafficPolicy targeting the shorter-named Gateway was incorrectly accepted even though a same-port HTTP listener exists on the other Gateway.
The port overlap validation used strings.Index without a trailing slash, causing 'envoy-gateway/gw' to falsely match 'envoy-gateway/gw-b/http'. This fix adds a trailing slash to the gateway name prefix and uses strings.HasPrefix for clarity.
Fixes #9226
Signed-off-by: Arunesh Dwivedi <[email protected]>1 parent d65425e commit 92d3fa1
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
401 | 401 | | |
402 | 402 | | |
403 | 403 | | |
404 | | - | |
| 404 | + | |
405 | 405 | | |
406 | 406 | | |
407 | | - | |
| 407 | + | |
408 | 408 | | |
409 | 409 | | |
410 | 410 | | |
| |||
0 commit comments