Commit d84e663
committed
fix(gateway): use TCP target group protocol for TLSRoute on passthrough NLB listeners
Motivation:
Issue #4556 reported that a Gateway API NLB listener with `protocol: TLS`
and `tls.mode: Passthrough` incorrectly built a TLS listener. That part
was already fixed in v3.1.0 by downgrading the listener protocol to TCP
for passthrough mode.
However, follow-up reports on the same issue (from 2026-03-04 and
2026-03-10) show the fix was incomplete: when a `TLSRoute` is bound to
such a passthrough listener, the controller still infers the *target
group* protocol as TLS. This produces a real AWS API error when
reconciling the load balancer:
IncompatibleProtocols: The listener and the following target groups
have incompatible protocols
because the (now TCP) listener cannot be attached to a TLS target group.
This is a functional failure, not cosmetic: the Gateway never reaches a
working state and reconciliation errors repeatedly.
Approach:
`inferTargetGroupProtocolFromRoute` in
pkg/gateway/model/model_build_target_group.go always returned
`ProtocolTLS` for `TLSRouteKind` on an NLB, regardless of the actual
listener protocol. It now takes the (already passthrough-downgraded)
listener protocol and returns `ProtocolTCP` when the listener protocol
is TCP, keeping `ProtocolTLS` for the `tls.mode: Terminate` case. Users
who explicitly set `targetGroupProps.Protocol` are unaffected, since
that explicit-override path is checked before the inference path.
This only changes NLB behavior for TLSRoute; ALB target group protocol
inference (which cannot take this NLB-only branch) is unaffected.
Validation:
go build ./...
go test -count=1 ./pkg/gateway/model/...
Both pass, including a corrected unit test case in
Test_buildTargetGroupProtocol that had been asserting the buggy
(mismatched) behavior.
Fixes #4556
Signed-off-by: Pujitha Paladugu <10557236+pujitha24@users.noreply.github.com>1 parent 3d15af0 commit d84e663
2 files changed
Lines changed: 13 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
355 | 355 | | |
356 | 356 | | |
357 | 357 | | |
358 | | - | |
| 358 | + | |
359 | 359 | | |
360 | 360 | | |
361 | 361 | | |
362 | 362 | | |
363 | 363 | | |
364 | | - | |
| 364 | + | |
365 | 365 | | |
366 | | - | |
| 366 | + | |
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
| |||
381 | 381 | | |
382 | 382 | | |
383 | 383 | | |
384 | | - | |
| 384 | + | |
385 | 385 | | |
386 | 386 | | |
387 | 387 | | |
| |||
398 | 398 | | |
399 | 399 | | |
400 | 400 | | |
401 | | - | |
| 401 | + | |
402 | 402 | | |
403 | 403 | | |
404 | 404 | | |
| |||
410 | 410 | | |
411 | 411 | | |
412 | 412 | | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
413 | 419 | | |
414 | 420 | | |
415 | 421 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
980 | 980 | | |
981 | 981 | | |
982 | 982 | | |
983 | | - | |
| 983 | + | |
984 | 984 | | |
985 | 985 | | |
986 | 986 | | |
987 | 987 | | |
988 | 988 | | |
989 | 989 | | |
990 | 990 | | |
991 | | - | |
| 991 | + | |
992 | 992 | | |
993 | 993 | | |
994 | 994 | | |
| |||
0 commit comments