@@ -2154,6 +2154,56 @@ func TestBuildConfiguration(t *testing.T) {
2154
2154
},
2155
2155
ResolvedSecret : & secret1NsName ,
2156
2156
},
2157
+ {
2158
+ Name : "tlsListener" ,
2159
+ Source : v1.Listener {
2160
+ Protocol : v1 .TLSProtocolType ,
2161
+ Port : 8443 ,
2162
+ },
2163
+ Routes : make (map [graph.RouteKey ]* graph.L7Route ),
2164
+ L4Routes : map [graph.L4RouteKey ]* graph.L4Route {
2165
+ {NamespacedName : types.NamespacedName {
2166
+ Namespace : "default" ,
2167
+ Name : "secure-app" ,
2168
+ }}: {
2169
+ Spec : graph.L4RouteSpec {
2170
+ Hostnames : []v1.Hostname {"app.example.com" , "cafe.example.com" },
2171
+ BackendRef : graph.BackendRef {
2172
+ SvcNsName : types.NamespacedName {
2173
+ Namespace : "default" ,
2174
+ Name : "secure-app" ,
2175
+ },
2176
+ ServicePort : apiv1.ServicePort {
2177
+ Name : "https" ,
2178
+ Protocol : "TCP" ,
2179
+ Port : 8443 ,
2180
+ TargetPort : intstr.IntOrString {
2181
+ Type : intstr .Int ,
2182
+ IntVal : 8443 ,
2183
+ },
2184
+ },
2185
+ Valid : true ,
2186
+ },
2187
+ },
2188
+ Valid : true ,
2189
+ },
2190
+ {NamespacedName : types.NamespacedName {
2191
+ Namespace : "default" ,
2192
+ Name : "secure-app2" ,
2193
+ }}: {},
2194
+ {NamespacedName : types.NamespacedName {
2195
+ Namespace : "default" ,
2196
+ Name : "secure-app3" ,
2197
+ }}: {
2198
+ Valid : true ,
2199
+ Spec : graph.L4RouteSpec {
2200
+ Hostnames : []v1.Hostname {"test.example.com" },
2201
+ BackendRef : graph.BackendRef {},
2202
+ },
2203
+ },
2204
+ },
2205
+ Valid : true ,
2206
+ },
2157
2207
},
2158
2208
Policies : []* graph.Policy {gwPolicy1 , gwPolicy2 },
2159
2209
},
@@ -2286,6 +2336,24 @@ func TestBuildConfiguration(t *testing.T) {
2286
2336
},
2287
2337
},
2288
2338
Upstreams : []Upstream {fooUpstream },
2339
+ StreamUpstreams : []Upstream {
2340
+ {
2341
+ Endpoints : fooEndpoints ,
2342
+ Name : "default_secure-app_8443" ,
2343
+ },
2344
+ },
2345
+ TLSPassthroughServers : []Layer4VirtualServer {
2346
+ {
2347
+ Hostname : "app.example.com" ,
2348
+ UpstreamName : "default_secure-app_8443" ,
2349
+ Port : 443 ,
2350
+ },
2351
+ {
2352
+ Hostname : "cafe.example.com" ,
2353
+ UpstreamName : "default_secure-app_8443" ,
2354
+ Port : 443 ,
2355
+ },
2356
+ },
2289
2357
BackendGroups : []BackendGroup {
2290
2358
expHRWithPolicyGroups [0 ],
2291
2359
expHTTPSHRWithPolicyGroups [0 ],
@@ -2294,7 +2362,7 @@ func TestBuildConfiguration(t *testing.T) {
2294
2362
HTTP2 : true ,
2295
2363
},
2296
2364
},
2297
- msg : "Simple Gateway and HTTPRoute with policies attached" ,
2365
+ msg : "Simple Gateway, HTTPRoute with policies attached and TLSRoute " ,
2298
2366
},
2299
2367
}
2300
2368
0 commit comments