@@ -2921,9 +2921,10 @@ func TestReconcile_TLSRouteOnPassthroughListenerTerminatesNothing(t *testing.T)
29212921// same hostname as the passthrough listener. Gateway API admits that —
29222922// its uniqueness rule is on (port, protocol, hostname) and the two
29232923// differ in protocol — and calls for both to be marked Conflicted, so
2924- // the hostname is served by neither. The pinned v1.19.5 marks nothing
2925- // and hands Envoy two chains under one server name; v1.19.6 marks the
2926- // pair from the listener specs alone.
2924+ // the hostname is served by neither. Cilium marks the pair from the
2925+ // listener specs alone and drops it from Envoy, and the operator patch
2926+ // that admits a wildcard beside a narrower passthrough listener keeps
2927+ // that for an identical hostname.
29272928func TestReconcile_TLSRouteOnPassthroughServiceTerminatesNothing (t * testing.T ) {
29282929 s := newScheme (t )
29292930 tgw := & gatewayv1alpha1.TenantGateway {
@@ -3487,9 +3488,9 @@ func TestReconcile_WildcardPassthroughWithdrawsTheNamesBeneathIt(t *testing.T) {
34873488// terminate listener leaves nothing on the Gateway for the route to
34883489// attach to, and Accepted=True would then describe a hostname the
34893490// controller deliberately dropped. Nothing on the Gateway says so
3490- // instead: the pinned Cilium sets no Conflicted condition , so the pair
3491- // rendered and left no record of the collision anywhere . That is what
3492- // makes the route condition the only place to say it.
3491+ // instead: the terminate listener is never rendered , so the Gateway
3492+ // holds no record of the claim . That is what makes the route condition
3493+ // the only place to say it.
34933494//
34943495// The reason must differ from HostnameConflict, which states that
34953496// another route won the same hostname. Nothing won this one.
@@ -3766,8 +3767,8 @@ func TestReconcile_TLSRouteLoserOnAPassthroughHostnameKeepsItsConflict(t *testin
37663767// accepted exactly when some listener answering its name would take a
37673768// route from its namespace.
37683769// noRouteHostnames marks a verdict-table row whose route declares no
3769- // spec.hostnames at all, the shape TLSRoute v1alpha2 permits and the
3770- // pinned Cilium serves on the hostname of the listener the route
3770+ // spec.hostnames at all, the shape TLSRoute v1alpha2 permits and
3771+ // Gateway API serves on the hostname of the listener the route
37713772// selects. Spelled as a name rather than left as a bare "" so a row
37723773// cannot be read as claiming the empty hostname.
37733774const noRouteHostnames = ""
@@ -3848,8 +3849,8 @@ func TestReconcile_TLSRouteVerdictTable(t *testing.T) {
38483849 {"section names no listener, tenant namespace" , "svc." + apex , "tenant-foo" ,
38493850 []string {"svc" }, nil , "tls-absent" , 0 , false , "tls-absent" , "" },
38503851 // A route that declares no hostnames is served on the hostname
3851- // of the listener it selects: ComputeHosts substitutes it at the
3852- // pin (operator/pkg/model/helpers.go, v1.19.5 ), so the claim
3852+ // of the listener it selects: ComputeHosts substitutes it
3853+ // (operator/pkg/model/helpers.go, v1.20.2 ), so the claim
38533854 // exists and is judged like a declared one. Pinning the listener
38543855 // by sectionName and leaving the hostname to it is the ordinary
38553856 // way to write such a route.
@@ -4264,9 +4265,9 @@ func TestReconcile_HostnameLessTLSRouteEntryIsRetractedWhenItsListenerGoes(t *te
42644265// TestReconcile_BorrowedHostnamesStopAtListenersTheRouteCanAttachTo
42654266// pins which listeners lend their hostname to a route that declares
42664267// none. A native-port listener admits the publishing tenant alone, so
4267- // the pinned Cilium never puts a route from elsewhere on it and never
4268- // serves that route on its hostname; a port-443 passthrough listener
4269- // takes every attached namespace and does lend. Borrowing from both
4268+ // no route from elsewhere attaches to it or is served on its
4269+ // hostname; a port-443 passthrough listener takes every attached
4270+ // namespace and does lend. Borrowing from both
42704271// hands a route a name its own object does not carry and then refuses
42714272// it for the namespace, in the same pass that sheds a terminate
42724273// listener because the very same route is serving the name it did
@@ -4352,11 +4353,9 @@ func TestReconcile_BorrowedHostnamesStopAtListenersTheRouteCanAttachTo(t *testin
43524353// the native-port listeners declare no kinds at all. The verdict is the
43534354// same on both.
43544355//
4355- // Nor does anything else tell the route: CheckGatewayRouteKindAllowed
4356- // (operator/pkg/gateway-api/routechecks/gateway_checks.go, v1.19.5)
4357- // reads each listener's kinds against every route on the Gateway rather
4358- // than against the routes that named it, so the HTTPRoute entry on the
4359- // port-443 listeners has Cilium report such a route Accepted.
4356+ // Nothing else is bound to tell the route: the port-443 listeners list
4357+ // HTTPRoute among their kinds, so whether the Gateway controller refuses
4358+ // such a route is left to the implementation.
43604359//
43614360// A route claiming the same hostname with no sectionName is refused
43624361// for the reservation instead, and one naming a listener outside the
@@ -6596,9 +6595,9 @@ func TestValidateTLSPassthroughListeners(t *testing.T) {
65966595 {"duplicate passthrough service" , nil ,
65976596 []string {"api" , "api" }, apex , true , "duplicate entry" },
65986597 // Gateway API keys listeners by (port, protocol, hostname), so
6599- // these are distinct and the object is accepted; Cilium routes
6600- // passthrough by SNI alone (cilium#42898) and silently serves
6601- // only one of them .
6598+ // these are distinct and the object is accepted; the controller
6599+ // refuses the pair, which Cilium before 1.19.6 served only one
6600+ // of (cilium#42898) .
66026601 {"same hostname on different ports" , []gatewayv1alpha1.TLSPassthroughListener {
66036602 mk ("pg" , 5432 , "db.foo.example.com" ),
66046603 mk ("pg2" , 5433 , "db.foo.example.com" ),
@@ -8648,16 +8647,15 @@ func TestReconcile_Port443ListenersShareKinds(t *testing.T) {
86488647 assertPort443Contract := func (t * testing.T , gw * gatewayv1.Gateway ) {
86498648 t .Helper ()
86508649 // Swept by whether the listener declares kinds at all, not by
8651- // port, because that is the shape of the check at the pinned
8652- // v1.19.5: CheckGatewayRouteKindAllowed walks every listener on
8653- // the Gateway with no port and no sectionName filter, skips the
8654- // ones whose kinds are empty, and overwrites the route's
8650+ // port, because that was the shape of the check before v1.19.6:
8651+ // CheckGatewayRouteKindAllowed walked every listener on the
8652+ // Gateway with no port and no sectionName filter, skipped the
8653+ // ones whose kinds were empty, and overwrote the route's
86558654 // Accepted condition on each of the rest, so the last listener
8656- // decides. One listener whose set omits HTTPRoute therefore
8657- // rejects every HTTPRoute on the Gateway, whatever port it
8658- // sits on. v1.19.6 narrows the walk to the listener the
8659- // parentRef names, which makes this sweep stricter than that
8660- // release requires rather than wrong for it.
8655+ // decided. v1.19.6 narrows the walk to the listener the
8656+ // parentRef names, which makes this sweep stricter than the
8657+ // shipped release requires rather than wrong for it; it goes
8658+ // with the uniform-kinds workaround.
86618659 var declared []gatewayv1.Listener
86628660 for _ , l := range gw .Spec .Listeners {
86638661 if l .AllowedRoutes != nil && len (l .AllowedRoutes .Kinds ) > 0 {
@@ -8988,10 +8986,10 @@ func TestReconcile_EdgeModeRendersPlainHTTPListeners(t *testing.T) {
89888986 }
89898987 if l .Hostname == nil {
89908988 // A hostname-less listener admits every host, and Cilium
8991- // reads only the first listener when deciding whether a
8992- // namespace may attach (cilium#42159), so one sitting at
8993- // index 0 with the narrow ACME selector detaches every
8994- // inheriting tenant's route.
8989+ // before 1.19.6 read only the first listener when deciding
8990+ // whether a namespace may attach (cilium#42159), so one
8991+ // sitting at index 0 with the narrow ACME selector detached
8992+ // every inheriting tenant's route.
89958993 t .Errorf ("edge mode must render no hostname-less listener, got %q" , l .Name )
89968994 continue
89978995 }
@@ -9324,7 +9322,7 @@ func TestReconcile_LeavingEdgeForAWildcardModeClearsTheWithdrawal(t *testing.T)
93249322// whole-apex pass leaves a route with no spec.hostnames alone, which is
93259323// not that the controller never judges one. Under http01 it does: the
93269324// route is judged on the hostname the listener its sectionName names
9327- // lends it, the way the pinned Cilium serves it. What decides the skip
9325+ // lends it, the way Gateway API serves it. What decides the skip
93289326// is the leg where that lends nothing. A route pinned to a section this
93299327// Gateway renders no listener for produces no claim under http01
93309328// either, so a refusal written on it under edge would have no pass that
0 commit comments