@@ -36,6 +36,7 @@ var GatewayWithAttachedRoutes = suite.ConformanceTest{
36
36
Description : "A Gateway in the gateway-conformance-infra namespace should be attached to routes." ,
37
37
Features : []suite.SupportedFeature {
38
38
suite .SupportGateway ,
39
+ suite .SupportHTTPRoute ,
39
40
},
40
41
Manifests : []string {"tests/gateway-with-attached-routes.yaml" },
41
42
Test : func (t * testing.T , s * suite.ConformanceTestSuite ) {
@@ -90,6 +91,52 @@ var GatewayWithAttachedRoutes = suite.ConformanceTest{
90
91
91
92
kubernetes .GatewayStatusMustHaveListeners (t , s .Client , s .TimeoutConfig , gwNN , listeners )
92
93
})
94
+
95
+ t .Run ("Gateway listener should have AttachedRoutes set even when Gateway has unresolved refs" , func (t * testing.T ) {
96
+ gwNN := types.NamespacedName {Name : "unresolved-gateway-with-one-attached-unresolved-route" , Namespace : "gateway-conformance-infra" }
97
+ listeners := []v1.ListenerStatus {{
98
+ Name : v1 .SectionName ("tls" ),
99
+ SupportedKinds : []v1.RouteGroupKind {{
100
+ Group : (* v1 .Group )(& v1 .GroupVersion .Group ),
101
+ Kind : v1 .Kind ("HTTPRoute" ),
102
+ }},
103
+ Conditions : []metav1.Condition {
104
+ {
105
+ Type : string (v1 .ListenerConditionAccepted ),
106
+ Status : metav1 .ConditionTrue ,
107
+ Reason : "" , // any reason
108
+ },
109
+ {
110
+ Type : string (v1 .ListenerConditionProgrammed ),
111
+ Status : metav1 .ConditionFalse ,
112
+ Reason : "" , // any reason
113
+ },
114
+ {
115
+ Type : string (v1 .ListenerConditionResolvedRefs ),
116
+ Status : metav1 .ConditionFalse ,
117
+ Reason : "" , // any reason
118
+ },
119
+ },
120
+ AttachedRoutes : 1 ,
121
+ }}
122
+
123
+ kubernetes .GatewayStatusMustHaveListeners (t , s .Client , s .TimeoutConfig , gwNN , listeners )
124
+
125
+ hrouteNN := types.NamespacedName {Name : "http-route-4" , Namespace : "gateway-conformance-infra" }
126
+ notAccepted := metav1.Condition {
127
+ Type : string (v1 .RouteConditionAccepted ),
128
+ Status : metav1 .ConditionTrue ,
129
+ Reason : "" , // any reason
130
+ }
131
+ unresolved := metav1.Condition {
132
+ Type : string (v1 .RouteConditionResolvedRefs ),
133
+ Status : metav1 .ConditionFalse ,
134
+ Reason : "" , // any reason
135
+ }
136
+
137
+ kubernetes .HTTPRouteMustHaveCondition (t , s .Client , s .TimeoutConfig , hrouteNN , gwNN , notAccepted )
138
+ kubernetes .HTTPRouteMustHaveCondition (t , s .Client , s .TimeoutConfig , hrouteNN , gwNN , unresolved )
139
+ })
93
140
},
94
141
}
95
142
@@ -99,6 +146,7 @@ var GatewayWithAttachedRoutesWithPort8080 = suite.ConformanceTest{
99
146
Features : []suite.SupportedFeature {
100
147
suite .SupportGateway ,
101
148
suite .SupportGatewayPort8080 ,
149
+ suite .SupportHTTPRoute ,
102
150
},
103
151
Manifests : []string {"tests/gateway-with-attached-routes-with-port-8080.yaml" },
104
152
Test : func (t * testing.T , s * suite.ConformanceTestSuite ) {
0 commit comments