@@ -6,80 +6,61 @@ import (
66
77 . "github.com/onsi/gomega"
88 gatewayv1 "sigs.k8s.io/gateway-api/apis/v1"
9+ "sigs.k8s.io/gateway-api/pkg/features"
910)
1011
1112func TestSupportedFeatures (t * testing.T ) {
1213 t .Parallel ()
1314
15+ standardFeatures := []gatewayv1.FeatureName {
16+ gatewayv1 .FeatureName (features .SupportBackendTLSPolicy ),
17+ gatewayv1 .FeatureName (features .SupportGRPCRoute ),
18+ gatewayv1 .FeatureName (features .SupportGateway ),
19+ gatewayv1 .FeatureName (features .SupportGatewayAddressEmpty ),
20+ gatewayv1 .FeatureName (features .SupportGatewayHTTPListenerIsolation ),
21+ gatewayv1 .FeatureName (features .SupportGatewayInfrastructurePropagation ),
22+ gatewayv1 .FeatureName (features .SupportGatewayPort8080 ),
23+ gatewayv1 .FeatureName (features .SupportGatewayStaticAddresses ),
24+ gatewayv1 .FeatureName (features .SupportHTTPRoute ),
25+ gatewayv1 .FeatureName (features .SupportHTTPRouteBackendProtocolWebSocket ),
26+ gatewayv1 .FeatureName (features .SupportHTTPRouteDestinationPortMatching ),
27+ gatewayv1 .FeatureName (features .SupportHTTPRouteHostRewrite ),
28+ gatewayv1 .FeatureName (features .SupportHTTPRouteMethodMatching ),
29+ gatewayv1 .FeatureName (features .SupportHTTPRouteParentRefPort ),
30+ gatewayv1 .FeatureName (features .SupportHTTPRoutePathRedirect ),
31+ gatewayv1 .FeatureName (features .SupportHTTPRoutePathRewrite ),
32+ gatewayv1 .FeatureName (features .SupportHTTPRoutePortRedirect ),
33+ gatewayv1 .FeatureName (features .SupportHTTPRouteQueryParamMatching ),
34+ gatewayv1 .FeatureName (features .SupportHTTPRouteRequestMirror ),
35+ gatewayv1 .FeatureName (features .SupportHTTPRouteRequestMultipleMirrors ),
36+ gatewayv1 .FeatureName (features .SupportHTTPRouteRequestPercentageMirror ),
37+ gatewayv1 .FeatureName (features .SupportHTTPRouteResponseHeaderModification ),
38+ gatewayv1 .FeatureName (features .SupportHTTPRouteSchemeRedirect ),
39+ gatewayv1 .FeatureName (features .SupportReferenceGrant ),
40+ }
41+
42+ experimentalFeatures := []gatewayv1.FeatureName {
43+ gatewayv1 .FeatureName (features .SupportTLSRoute ),
44+ }
45+
46+ allFeatures := append (slices .Clone (standardFeatures ), experimentalFeatures ... )
47+
1448 tests := []struct {
1549 name string
1650 expectedFeatures []gatewayv1.FeatureName
1751 unexpectedFeatures []gatewayv1.FeatureName
1852 experimental bool
1953 }{
2054 {
21- name : "standard features only" ,
22- experimental : false ,
23- expectedFeatures : []gatewayv1.FeatureName {
24- "BackendTLSPolicy" ,
25- "GRPCRoute" ,
26- "Gateway" ,
27- "GatewayAddressEmpty" ,
28- "GatewayHTTPListenerIsolation" ,
29- "GatewayInfrastructurePropagation" ,
30- "GatewayPort8080" ,
31- "GatewayStaticAddresses" ,
32- "HTTPRoute" ,
33- "HTTPRouteBackendProtocolWebSocket" ,
34- "HTTPRouteDestinationPortMatching" ,
35- "HTTPRouteHostRewrite" ,
36- "HTTPRouteMethodMatching" ,
37- "HTTPRouteParentRefPort" ,
38- "HTTPRoutePathRedirect" ,
39- "HTTPRoutePathRewrite" ,
40- "HTTPRoutePortRedirect" ,
41- "HTTPRouteQueryParamMatching" ,
42- "HTTPRouteRequestMirror" ,
43- "HTTPRouteRequestMultipleMirrors" ,
44- "HTTPRouteRequestPercentageMirror" ,
45- "HTTPRouteResponseHeaderModification" ,
46- "HTTPRouteSchemeRedirect" ,
47- "ReferenceGrant" ,
48- },
49- unexpectedFeatures : []gatewayv1.FeatureName {
50- "TLSRoute" ,
51- },
55+ name : "standard features only" ,
56+ experimental : false ,
57+ expectedFeatures : standardFeatures ,
58+ unexpectedFeatures : experimentalFeatures ,
5259 },
5360 {
54- name : "standard and experimental features" ,
55- experimental : true ,
56- expectedFeatures : []gatewayv1.FeatureName {
57- "BackendTLSPolicy" ,
58- "GRPCRoute" ,
59- "Gateway" ,
60- "GatewayAddressEmpty" ,
61- "GatewayHTTPListenerIsolation" ,
62- "GatewayInfrastructurePropagation" ,
63- "GatewayPort8080" ,
64- "GatewayStaticAddresses" ,
65- "HTTPRoute" ,
66- "HTTPRouteBackendProtocolWebSocket" ,
67- "HTTPRouteDestinationPortMatching" ,
68- "HTTPRouteHostRewrite" ,
69- "HTTPRouteMethodMatching" ,
70- "HTTPRouteParentRefPort" ,
71- "HTTPRoutePathRedirect" ,
72- "HTTPRoutePathRewrite" ,
73- "HTTPRoutePortRedirect" ,
74- "HTTPRouteQueryParamMatching" ,
75- "HTTPRouteRequestMirror" ,
76- "HTTPRouteRequestMultipleMirrors" ,
77- "HTTPRouteRequestPercentageMirror" ,
78- "HTTPRouteResponseHeaderModification" ,
79- "HTTPRouteSchemeRedirect" ,
80- "ReferenceGrant" ,
81- "TLSRoute" ,
82- },
61+ name : "standard and experimental features" ,
62+ experimental : true ,
63+ expectedFeatures : allFeatures ,
8364 unexpectedFeatures : []gatewayv1.FeatureName {},
8465 },
8566 }
0 commit comments