@@ -261,6 +261,46 @@ var _ = Describe("ClusterManager API test with RegistrationConfiguration", func(
261
261
Expect (clusterManager .Spec .RegistrationConfiguration .FeatureGates [0 ].Mode ).Should (Equal (operatorv1 .FeatureGateModeTypeDisable ))
262
262
Expect (clusterManager .Spec .RegistrationConfiguration .FeatureGates [1 ].Mode ).Should (Equal (operatorv1 .FeatureGateModeTypeEnable ))
263
263
})
264
+
265
+ It ("Create a cluster manager with aws registration and invalid hubClusterArn" , func () {
266
+ clusterManager := & operatorv1.ClusterManager {
267
+ ObjectMeta : metav1.ObjectMeta {
268
+ Name : clusterManagerName ,
269
+ },
270
+ Spec : operatorv1.ClusterManagerSpec {
271
+ RegistrationConfiguration : & operatorv1.RegistrationHubConfiguration {
272
+ RegistrationDrivers : []operatorv1.RegistrationDriverHub {
273
+ {
274
+ AuthType : "awsirsa" ,
275
+ HubClusterArn : "arn:aws:bks:us-west-2:123456789012:cluster/hub-cluster1" ,
276
+ },
277
+ },
278
+ },
279
+ },
280
+ }
281
+ _ , err := operatorClient .OperatorV1 ().ClusterManagers ().Create (context .TODO (), clusterManager , metav1.CreateOptions {})
282
+ Expect (err ).ToNot (BeNil ())
283
+ })
284
+
285
+ It ("Create a cluster manager with aws registration and valid hubClusterArn" , func () {
286
+ clusterManager := & operatorv1.ClusterManager {
287
+ ObjectMeta : metav1.ObjectMeta {
288
+ Name : clusterManagerName ,
289
+ },
290
+ Spec : operatorv1.ClusterManagerSpec {
291
+ RegistrationConfiguration : & operatorv1.RegistrationHubConfiguration {
292
+ RegistrationDrivers : []operatorv1.RegistrationDriverHub {
293
+ {
294
+ AuthType : "awsirsa" ,
295
+ HubClusterArn : "arn:aws:eks:us-west-2:123456789012:cluster/hub-cluster1" ,
296
+ },
297
+ },
298
+ },
299
+ },
300
+ }
301
+ _ , err := operatorClient .OperatorV1 ().ClusterManagers ().Create (context .TODO (), clusterManager , metav1.CreateOptions {})
302
+ Expect (err ).To (BeNil ())
303
+ })
264
304
})
265
305
266
306
var _ = Describe ("ClusterManager API test with WorkConfiguration" , func () {
0 commit comments