@@ -55,15 +55,16 @@ type ConformanceTestSuite struct {
55
55
56
56
// Options can be used to initialize a ConformanceTestSuite.
57
57
type Options struct {
58
- Client client.Client
59
- Clientset clientset.Interface
60
- RestConfig * rest.Config
61
- GatewayClassName string
62
- Debug bool
63
- RoundTripper roundtripper.RoundTripper
64
- BaseManifests string
65
- MeshManifests string
66
- NamespaceLabels map [string ]string
58
+ Client client.Client
59
+ Clientset clientset.Interface
60
+ RestConfig * rest.Config
61
+ GatewayClassName string
62
+ Debug bool
63
+ RoundTripper roundtripper.RoundTripper
64
+ BaseManifests string
65
+ MeshManifests string
66
+ NamespaceLabels map [string ]string
67
+ NamespaceAnnotations map [string ]string
67
68
68
69
// CleanupBaseResources indicates whether or not the base test
69
70
// resources such as Gateways should be cleaned up after the run.
@@ -118,7 +119,8 @@ func New(s Options) *ConformanceTestSuite {
118
119
BaseManifests : s .BaseManifests ,
119
120
MeshManifests : s .MeshManifests ,
120
121
Applier : kubernetes.Applier {
121
- NamespaceLabels : s .NamespaceLabels ,
122
+ NamespaceLabels : s .NamespaceLabels ,
123
+ NamespaceAnnotations : s .NamespaceAnnotations ,
122
124
},
123
125
SupportedFeatures : s .SupportedFeatures ,
124
126
TimeoutConfig : s .TimeoutConfig ,
@@ -261,6 +263,22 @@ func ParseNamespaceLabels(f string) map[string]string {
261
263
return res
262
264
}
263
265
266
+ // ParseNamespaceAnnotations parses flag arguments and converts the string to
267
+ // map[string]string containing annotation key/value pairs.
268
+ func ParseNamespaceAnnotations (f string ) map [string ]string {
269
+ if f == "" {
270
+ return nil
271
+ }
272
+ res := map [string ]string {}
273
+ for _ , kv := range strings .Split (f , "," ) {
274
+ parts := strings .Split (kv , "=" )
275
+ if len (parts ) == 2 {
276
+ res [parts [0 ]] = parts [1 ]
277
+ }
278
+ }
279
+ return res
280
+ }
281
+
264
282
// ParseSkipTests parses flag arguments and converts the string to
265
283
// []string containing the tests to be skipped.
266
284
func ParseSkipTests (t string ) []string {
0 commit comments