Skip to content

Commit

Permalink
feat: fix unit test.`
Browse files Browse the repository at this point in the history
  • Loading branch information
ramekris3163 committed Jan 14, 2025
1 parent 51633a6 commit 7c46414
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/e2e/clusteradm/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,26 +40,26 @@ var _ = ginkgo.Describe("test clusteradm with bootstrap token in singleton mode"
"--use-bootstrap-token",
"--context", e2e.Cluster().Hub().Context(),
"--bundle-version=latest",
"--registration-auth awsirsa"
"--registration-auth aws-irsa",
)
gomega.Expect(err).NotTo(gomega.HaveOccurred(), "clusteradm init error")

cm, err := operatorClient.OperatorV1().ClusterManagers().Get(context.TODO(), "cluster-manager", metav1.GetOptions{})
cm, err = operatorClient.OperatorV1().ClusterManagers().Get(context.TODO(), "cluster-manager", metav1.GetOptions{})
gomega.Expect(err).NotTo(gomega.HaveOccurred())
gomega.Expect(len(cm.Spec.RegistrationConfiguration.FeatureGates)).Should(gomega.Equal(1))
// Ensure that when only awsirsa is passed as registration-auth both the values are set.
gomega.Expect(len(cm.Spec.RegistrationConfiguration.RegistrationDrivers)).Should(gomega.Equal(2))
gomega.Expect(len(cm.Spec.RegistrationConfiguration.RegistrationDrivers)).Should(gomega.Equal(1))

err = e2e.Clusteradm().Init(
"--use-bootstrap-token",
"--context", e2e.Cluster().Hub().Context(),
"--bundle-version=latest",
"--registration-auth awsirsa",
"--registration-auth csr"
"--registration-auth aws-irsa",
"--registration-auth csr",
)
gomega.Expect(err).NotTo(gomega.HaveOccurred(), "clusteradm init error")

cm, err := operatorClient.OperatorV1().ClusterManagers().Get(context.TODO(), "cluster-manager", metav1.GetOptions{})
cm, err = operatorClient.OperatorV1().ClusterManagers().Get(context.TODO(), "cluster-manager", metav1.GetOptions{})
gomega.Expect(err).NotTo(gomega.HaveOccurred())
gomega.Expect(len(cm.Spec.RegistrationConfiguration.FeatureGates)).Should(gomega.Equal(1))
// Ensure that awsirsa and csr is passed as registration-auth both the values are set.
Expand Down

0 comments on commit 7c46414

Please sign in to comment.