@@ -18,7 +18,6 @@ limitations under the License.
18
18
package conformance_test
19
19
20
20
import (
21
- "strings"
22
21
"testing"
23
22
24
23
"sigs.k8s.io/gateway-api/apis/v1alpha2"
@@ -27,7 +26,6 @@ import (
27
26
"sigs.k8s.io/gateway-api/conformance/utils/flags"
28
27
"sigs.k8s.io/gateway-api/conformance/utils/suite"
29
28
30
- "k8s.io/apimachinery/pkg/util/sets"
31
29
"k8s.io/client-go/kubernetes"
32
30
_ "k8s.io/client-go/plugin/pkg/client/auth"
33
31
"k8s.io/client-go/rest"
@@ -52,8 +50,10 @@ func TestConformance(t *testing.T) {
52
50
v1alpha2 .AddToScheme (client .Scheme ())
53
51
v1beta1 .AddToScheme (client .Scheme ())
54
52
55
- supportedFeatures := parseSupportedFeatures (* flags .SupportedFeatures )
56
- exemptFeatures := parseSupportedFeatures (* flags .ExemptFeatures )
53
+ supportedFeatures := suite .ParseSupportedFeatures (* flags .SupportedFeatures )
54
+ exemptFeatures := suite .ParseSupportedFeatures (* flags .ExemptFeatures )
55
+
56
+ namespaceLabels := suite .ParseNamespaceLabels (* flags .NamespaceLabels )
57
57
58
58
t .Logf ("Running conformance tests with %s GatewayClass\n cleanup: %t\n debug: %t\n enable all features: %t \n supported features: [%v]\n exempt features: [%v]" ,
59
59
* flags .GatewayClassName , * flags .CleanupBaseResources , * flags .ShowDebug , * flags .EnableAllSupportedFeatures , * flags .SupportedFeatures , * flags .ExemptFeatures )
@@ -68,21 +68,9 @@ func TestConformance(t *testing.T) {
68
68
SupportedFeatures : supportedFeatures ,
69
69
ExemptFeatures : exemptFeatures ,
70
70
EnableAllSupportedFeatures : * flags .EnableAllSupportedFeatures ,
71
+ NamespaceLabels : namespaceLabels ,
71
72
})
72
73
cSuite .Setup (t )
73
74
74
75
cSuite .Run (t , tests .ConformanceTests )
75
76
}
76
-
77
- // parseSupportedFeatures parses flag arguments and converts the string to
78
- // sets.Set[suite.SupportedFeature]
79
- func parseSupportedFeatures (f string ) sets.Set [suite.SupportedFeature ] {
80
- if f == "" {
81
- return nil
82
- }
83
- res := sets.Set [suite.SupportedFeature ]{}
84
- for _ , value := range strings .Split (f , "," ) {
85
- res .Insert (suite .SupportedFeature (value ))
86
- }
87
- return res
88
- }
0 commit comments