@@ -20,6 +20,7 @@ import (
20
20
clientgo_fake "k8s.io/client-go/kubernetes/fake"
21
21
"k8s.io/client-go/kubernetes/scheme"
22
22
ctrlclient_fake "sigs.k8s.io/controller-runtime/pkg/client/fake"
23
+ gatewayv1 "sigs.k8s.io/gateway-api/apis/v1"
23
24
gatewayv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2"
24
25
gatewayv1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1"
25
26
@@ -122,6 +123,7 @@ func TestWorkflowClusterState(t *testing.T) {
122
123
})
123
124
124
125
t .Run ("properly reports cluster state" , func (t * testing.T ) {
126
+ require .NoError (t , gatewayv1 .Install (scheme .Scheme ))
125
127
require .NoError (t , gatewayv1beta1 .Install (scheme .Scheme ))
126
128
require .NoError (t , gatewayv1alpha2 .Install (scheme .Scheme ))
127
129
@@ -152,19 +154,19 @@ func TestWorkflowClusterState(t *testing.T) {
152
154
Name : "srv" ,
153
155
},
154
156
},
155
- & gatewayv1beta1 .GatewayClass {
157
+ & gatewayv1 .GatewayClass {
156
158
ObjectMeta : metav1.ObjectMeta {
157
159
Namespace : "kong" ,
158
160
Name : "gatewayclass-1" ,
159
161
},
160
162
},
161
- & gatewayv1beta1 .Gateway {
163
+ & gatewayv1 .Gateway {
162
164
ObjectMeta : metav1.ObjectMeta {
163
165
Namespace : "kong" ,
164
166
Name : "gateway-1" ,
165
167
},
166
168
},
167
- & gatewayv1beta1 .HTTPRoute {
169
+ & gatewayv1 .HTTPRoute {
168
170
ObjectMeta : metav1.ObjectMeta {
169
171
Namespace : "kong" ,
170
172
Name : "httproute-1" ,
@@ -176,7 +178,7 @@ func TestWorkflowClusterState(t *testing.T) {
176
178
Name : "referencegrant-1" ,
177
179
},
178
180
},
179
- & gatewayv1alpha2 .GRPCRoute {
181
+ & gatewayv1 .GRPCRoute {
180
182
ObjectMeta : metav1.ObjectMeta {
181
183
Namespace : "kong" ,
182
184
Name : "grpcroute-1" ,
@@ -272,11 +274,11 @@ func TestWorkflowClusterState(t *testing.T) {
272
274
meta .RESTScopeRoot ,
273
275
)
274
276
}
275
- as (gatewayv1beta1 .GroupVersion , "GatewayClass" , "gatewayclasses" )
276
- as (gatewayv1beta1 .GroupVersion , "Gateway" , "gateways" )
277
- as (gatewayv1beta1 .GroupVersion , "HTTPRoute" , "httproutes" )
277
+ as (gatewayv1 .GroupVersion , "GatewayClass" , "gatewayclasses" )
278
+ as (gatewayv1 .GroupVersion , "Gateway" , "gateways" )
279
+ as (gatewayv1 .GroupVersion , "HTTPRoute" , "httproutes" )
280
+ as (gatewayv1 .GroupVersion , "GRPCRoute" , "grpcroutes" )
278
281
as (gatewayv1beta1 .GroupVersion , "ReferenceGrant" , "referencegrants" )
279
- as (gatewayv1alpha2 .GroupVersion , "GRPCRoute" , "grpcroutes" )
280
282
as (gatewayv1alpha2 .GroupVersion , "TCPRoute" , "tcproutes" )
281
283
as (gatewayv1alpha2 .GroupVersion , "UDPRoute" , "udproutes" )
282
284
as (gatewayv1alpha2 .GroupVersion , "TLSRoute" , "tlsroutes" )
@@ -293,7 +295,7 @@ func TestWorkflowClusterState(t *testing.T) {
293
295
map [schema.GroupVersionResource ]string {
294
296
{
295
297
Group : "gateway.networking.k8s.io" ,
296
- Version : "v1beta1 " ,
298
+ Version : "v1 " ,
297
299
Resource : "gateways" ,
298
300
}: "GatewayList" ,
299
301
},
@@ -312,17 +314,17 @@ func TestWorkflowClusterState(t *testing.T) {
312
314
provider .NodeCountKey : 2 ,
313
315
provider .PodCountKey : 1 ,
314
316
provider .ServiceCountKey : 2 ,
315
- // gateway.networking.k8s.io v1beta1
317
+ // gateway.networking.k8s.io v1
318
+ provider .GRPCRouteCountKey : 1 ,
319
+ provider .HTTPRouteCountKey : 1 ,
316
320
provider .GatewayClassCountKey : 1 ,
317
- // This should be equal to 1 but see above for comment explaining the issue.
318
- provider .GatewayCountKey : 0 ,
319
- provider .HTTPRouteCountKey : 1 ,
321
+ provider .GatewayCountKey : 0 , // This should be equal to 1 but see above for comment explaining the issue.
322
+ // gateway.networking.k8s.io v1beta1
320
323
provider .ReferenceGrantCountKey : 1 ,
321
324
// gateway.networking.k8s.io v1alpha2
322
- provider .GRPCRouteCountKey : 1 ,
323
- provider .TCPRouteCountKey : 1 ,
324
- provider .UDPRouteCountKey : 1 ,
325
- provider .TLSRouteCountKey : 1 ,
325
+ provider .TCPRouteCountKey : 1 ,
326
+ provider .UDPRouteCountKey : 1 ,
327
+ provider .TLSRouteCountKey : 1 ,
326
328
}, r )
327
329
})
328
330
0 commit comments