@@ -34,47 +34,48 @@ var _ = ginkgo.Describe("test clusteradm with bootstrap token in singleton mode"
34
34
gomega .Expect (err ).NotTo (gomega .HaveOccurred ())
35
35
gomega .Expect (len (cm .Spec .RegistrationConfiguration .FeatureGates )).Should (gomega .Equal (1 ))
36
36
37
- // TODO: E2e test is not recognizing the newly added flags. Uncomment below test once the problem is fixed.
38
- //err = e2e.Clusteradm().Init(
39
- // "--use-bootstrap-token",
40
- // "--context", e2e.Cluster().Hub().Context(),
41
- // "--bundle-version=latest",
42
- // "--registration-auth awsirsa",
43
- // "--hub-cluster-arn arn:aws:eks:us-west-2:123456789012:cluster/hub-cluster1",
44
- //)
45
- //gomega.Expect(err).NotTo(gomega.HaveOccurred(), "clusteradm init error")
46
- //
47
- //cm, err = operatorClient.OperatorV1().ClusterManagers().Get(context.TODO(), "cluster-manager", metav1.GetOptions{})
48
- //gomega.Expect(err).NotTo(gomega.HaveOccurred())
49
- //// Ensure that when only awsirsa is passed as registration-auth only awsirsa driver is available
50
- //gomega.Expect(len(cm.Spec.RegistrationConfiguration.RegistrationDrivers)).Should(gomega.Equal(1))
51
- //gomega.Expect(cm.Spec.RegistrationConfiguration.RegistrationDrivers[0].AuthType).Should(gomega.Equal("awsirsa"))
52
- //
53
- //err = e2e.Clusteradm().Init(
54
- // "--use-bootstrap-token",
55
- // "--context", e2e.Cluster().Hub().Context(),
56
- // "--bundle-version=latest",
57
- // "--registration-auth awsirsa",
58
- // "--registration-auth csr",
59
- // "--hub-cluster-arn arn:aws:eks:us-west-2:123456789012:cluster/hub-cluster1",
60
- //)
61
- //gomega.Expect(err).NotTo(gomega.HaveOccurred(), "clusteradm init error")
62
- //
63
- //cm, err = operatorClient.OperatorV1().ClusterManagers().Get(context.TODO(), "cluster-manager", metav1.GetOptions{})
64
- //gomega.Expect(err).NotTo(gomega.HaveOccurred())
65
- //// Ensure that awsirsa and csr is passed as registration-auth both the values are set.
66
- //gomega.Expect(len(cm.Spec.RegistrationConfiguration.RegistrationDrivers)).Should(gomega.Equal(2))
67
- //gomega.Expect(cm.Spec.RegistrationConfiguration.RegistrationDrivers[0].AuthType).Should(gomega.Equal("csr"))
68
- //gomega.Expect(cm.Spec.RegistrationConfiguration.RegistrationDrivers[1].AuthType).Should(gomega.Equal("awsirsa"))
69
- //gomega.Expect(cm.Spec.RegistrationConfiguration.RegistrationDrivers[1].HubClusterArn).
70
- // Should(gomega.Equal("arn:aws:eks:us-west-2:123456789012:cluster/hub-cluster1"))
37
+ err = e2e .Clusteradm ().Init (
38
+ "--use-bootstrap-token" ,
39
+ "--context" , e2e .Cluster ().Hub ().Context (),
40
+ "--bundle-version=latest" ,
41
+ "--registration-auth=awsirsa" ,
42
+ "--hub-cluster-arn=arn:aws:eks:us-west-2:123456789012:cluster/hub-cluster1" ,
43
+ )
44
+ gomega .Expect (err ).NotTo (gomega .HaveOccurred (), "clusteradm init error" )
45
+
46
+ cm , err = operatorClient .OperatorV1 ().ClusterManagers ().Get (context .TODO (), "cluster-manager" , metav1.GetOptions {})
47
+ gomega .Expect (err ).NotTo (gomega .HaveOccurred ())
48
+ // Ensure that when only awsirsa is passed as registration-auth only awsirsa driver is available
49
+ gomega .Expect (len (cm .Spec .RegistrationConfiguration .RegistrationDrivers )).Should (gomega .Equal (1 ))
50
+ gomega .Expect (cm .Spec .RegistrationConfiguration .RegistrationDrivers [0 ].AuthType ).Should (gomega .Equal ("awsirsa" ))
71
51
72
52
err = e2e .Clusteradm ().Init (
73
53
"--use-bootstrap-token" ,
74
54
"--context" , e2e .Cluster ().Hub ().Context (),
75
55
"--bundle-version=latest" ,
76
56
"--registration-auth=awsirsa" ,
77
57
"--registration-auth=csr" ,
58
+ "--hub-cluster-arn=arn:aws:eks:us-west-2:123456789012:cluster/hub-cluster1" ,
59
+ )
60
+ gomega .Expect (err ).NotTo (gomega .HaveOccurred (), "clusteradm init error" )
61
+
62
+ cm , err = operatorClient .OperatorV1 ().ClusterManagers ().Get (context .TODO (), "cluster-manager" , metav1.GetOptions {})
63
+ gomega .Expect (err ).NotTo (gomega .HaveOccurred ())
64
+ // Ensure that awsirsa and csr is passed as registration-auth both the values are set.
65
+ gomega .Expect (len (cm .Spec .RegistrationConfiguration .RegistrationDrivers )).Should (gomega .Equal (2 ))
66
+ gomega .Expect (cm .Spec .RegistrationConfiguration .RegistrationDrivers [0 ].AuthType ).Should (gomega .Equal ("csr" ))
67
+ gomega .Expect (cm .Spec .RegistrationConfiguration .RegistrationDrivers [1 ].AuthType ).Should (gomega .Equal ("awsirsa" ))
68
+ gomega .Expect (cm .Spec .RegistrationConfiguration .RegistrationDrivers [1 ].HubClusterArn ).
69
+ Should (gomega .Equal ("arn:aws:eks:us-west-2:123456789012:cluster/hub-cluster1" ))
70
+
71
+ err = e2e .Clusteradm ().Init (
72
+ "--use-bootstrap-token" ,
73
+ "--context" , e2e .Cluster ().Hub ().Context (),
74
+ "--bundle-version=latest" ,
75
+ "--registration-auth=awsirsa" ,
76
+ "--registration-auth=csr" ,
77
+ "--hub-cluster-arn=arn:aws:eks:us-west-2:123456789012:cluster/hub-cluster1" ,
78
+ "--feature-gates=ManagedClusterAutoApproval=true" ,
78
79
"--auto-approved-csr-identities=csr1" ,
79
80
"--auto-approved-arn-patterns=arn:aws:eks:us-west-2:123456789012:cluster/*" ,
80
81
)
0 commit comments