From 484227190434d1d093c87ca85a8eba266b4ded6c Mon Sep 17 00:00:00 2001 From: Gaurav Jaswal Date: Fri, 17 Jan 2025 18:00:09 -0500 Subject: [PATCH] Removing clusteradm init e2e tests because of validation failure for hubClusterArn Signed-off-by: Gaurav Jaswal --- go.mod | 2 ++ go.sum | 2 -- test/e2e/clusteradm/init_test.go | 27 ------------------- vendor/modules.txt | 3 ++- ...ter-management.io_clustermanagers.crd.yaml | 25 +++++++++++++++++ .../templates/bootstrap_cluster_role.yaml | 2 +- .../bootstrap_cluster_role_binding.yaml | 4 +-- .../templates/bootstrap_sa.yaml | 2 +- .../bootstrap_sa_cluster_role_binding.yaml | 6 ++--- .../templates/cluster_manager.yaml | 6 ++++- .../templates/cluster_role.yaml | 2 +- 11 files changed, 42 insertions(+), 39 deletions(-) diff --git a/go.mod b/go.mod index fc6ff5b5..2c4971c9 100644 --- a/go.mod +++ b/go.mod @@ -2,6 +2,8 @@ module open-cluster-management.io/clusteradm go 1.22.6 +replace open-cluster-management.io/ocm => /Users/gjaswal/Documents/codebase/guidewire-oss/ocm + require ( github.com/briandowns/spinner v1.23.0 github.com/disiqueira/gotree v1.0.0 diff --git a/go.sum b/go.sum index 99c58dc4..00e22e8a 100644 --- a/go.sum +++ b/go.sum @@ -563,8 +563,6 @@ open-cluster-management.io/cluster-proxy v0.4.0 h1:rm0UDaDWe3/P3xLzwqdHtqNksKwSz open-cluster-management.io/cluster-proxy v0.4.0/go.mod h1:gTvfDHAhGezhdg4BD3ECBn6jbg2Y5PbHhV2ceW5nrB0= open-cluster-management.io/managed-serviceaccount v0.6.0 h1:qIi5T9WQJBuoGqnYGIktXbtqfQoiN2H9XU2P/6lAQiw= open-cluster-management.io/managed-serviceaccount v0.6.0/go.mod h1:G4LUTbZiyrB8c0+rqi/xnDmGlsg7Rdr4T7MPLCWhyQI= -open-cluster-management.io/ocm v0.15.1-0.20250116085531-34275ef1eac8 h1:IDjk8EeKajwqezVM1eDNYPHyaJx4V0N/sZoSAVhIUJk= -open-cluster-management.io/ocm v0.15.1-0.20250116085531-34275ef1eac8/go.mod h1:daPkqFxkVqKb4O8UTX+7jCyEcJWarGOG7uDie9rFfck= open-cluster-management.io/sdk-go v0.15.1-0.20241125015855-1536c3970f8f h1:zeC7QrFNarfK2zY6jGtd+mX+yDrQQmnH/J8A7n5Nh38= open-cluster-management.io/sdk-go v0.15.1-0.20241125015855-1536c3970f8f/go.mod h1:fi5WBsbC5K3txKb8eRLuP0Sim/Oqz/PHX18skAEyjiA= oras.land/oras-go v1.2.5 h1:XpYuAwAb0DfQsunIyMfeET92emK8km3W4yEzZvUbsTo= diff --git a/test/e2e/clusteradm/init_test.go b/test/e2e/clusteradm/init_test.go index 6c77ef5a..a1890707 100644 --- a/test/e2e/clusteradm/init_test.go +++ b/test/e2e/clusteradm/init_test.go @@ -34,33 +34,6 @@ var _ = ginkgo.Describe("test clusteradm with bootstrap token in singleton mode" gomega.Expect(err).NotTo(gomega.HaveOccurred()) gomega.Expect(len(cm.Spec.RegistrationConfiguration.FeatureGates)).Should(gomega.Equal(1)) - err = e2e.Clusteradm().Init( - "--use-bootstrap-token", - "--context", e2e.Cluster().Hub().Context(), - "--bundle-version=latest", - "--registration-auth awsirsa", - ) - gomega.Expect(err).NotTo(gomega.HaveOccurred(), "clusteradm init error") - - cm, err = operatorClient.OperatorV1().ClusterManagers().Get(context.TODO(), "cluster-manager", metav1.GetOptions{}) - gomega.Expect(err).NotTo(gomega.HaveOccurred()) - // Ensure that when only awsirsa is passed as registration-auth only awsirsa driver is available - 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", - ) - gomega.Expect(err).NotTo(gomega.HaveOccurred(), "clusteradm init error") - - cm, err = operatorClient.OperatorV1().ClusterManagers().Get(context.TODO(), "cluster-manager", metav1.GetOptions{}) - gomega.Expect(err).NotTo(gomega.HaveOccurred()) - // Ensure that awsirsa and csr is passed as registration-auth both the values are set. - gomega.Expect(len(cm.Spec.RegistrationConfiguration.RegistrationDrivers)).Should(gomega.Equal(2)) - err = e2e.Clusteradm().Init( "--use-bootstrap-token", "--context", e2e.Cluster().Hub().Context(), diff --git a/vendor/modules.txt b/vendor/modules.txt index f97d3fdb..29210ee5 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1282,7 +1282,7 @@ open-cluster-management.io/managed-serviceaccount/pkg/generated/clientset/versio open-cluster-management.io/managed-serviceaccount/pkg/generated/clientset/versioned/scheme open-cluster-management.io/managed-serviceaccount/pkg/generated/clientset/versioned/typed/authentication/v1alpha1 open-cluster-management.io/managed-serviceaccount/pkg/generated/clientset/versioned/typed/authentication/v1beta1 -# open-cluster-management.io/ocm v0.15.1-0.20250116085531-34275ef1eac8 +# open-cluster-management.io/ocm v0.15.1-0.20250116085531-34275ef1eac8 => /Users/gjaswal/Documents/codebase/guidewire-oss/ocm ## explicit; go 1.22.5 open-cluster-management.io/ocm/deploy/cluster-manager/chart open-cluster-management.io/ocm/deploy/klusterlet/chart @@ -1432,3 +1432,4 @@ sigs.k8s.io/structured-merge-diff/v4/value sigs.k8s.io/yaml sigs.k8s.io/yaml/goyaml.v2 sigs.k8s.io/yaml/goyaml.v3 +# open-cluster-management.io/ocm => /Users/gjaswal/Documents/codebase/guidewire-oss/ocm diff --git a/vendor/open-cluster-management.io/ocm/deploy/cluster-manager/chart/cluster-manager/crds/0000_01_operator.open-cluster-management.io_clustermanagers.crd.yaml b/vendor/open-cluster-management.io/ocm/deploy/cluster-manager/chart/cluster-manager/crds/0000_01_operator.open-cluster-management.io_clustermanagers.crd.yaml index 8e92beeb..c4e3864f 100644 --- a/vendor/open-cluster-management.io/ocm/deploy/cluster-manager/chart/cluster-manager/crds/0000_01_operator.open-cluster-management.io_clustermanagers.crd.yaml +++ b/vendor/open-cluster-management.io/ocm/deploy/cluster-manager/chart/cluster-manager/crds/0000_01_operator.open-cluster-management.io_clustermanagers.crd.yaml @@ -255,6 +255,31 @@ spec: - feature type: object type: array + registrationDrivers: + description: |- + RegistrationDrivers represent the list of hub registration drivers that contain information used by hub to initialize the hub cluster + A RegistrationDriverHub contains details of authentication type and the hub cluster ARN + items: + properties: + authType: + default: csr + description: Type of the authentication used by hub to initialize + the Hub cluster. Possible values are csr and awsirsa. + enum: + - csr + - awsirsa + type: string + hubClusterArn: + description: |- + This represents the hub cluster ARN + Example - arn:eks:us-west-2:12345678910:cluster/hub-cluster1 + pattern: ^arn:aws:eks:([a-zA-Z0-9-]+):(\d{12}):cluster/([a-zA-Z0-9-]+)$ + type: string + type: object + type: array + x-kubernetes-list-map-keys: + - authType + x-kubernetes-list-type: map type: object registrationImagePullSpec: default: quay.io/open-cluster-management/registration diff --git a/vendor/open-cluster-management.io/ocm/deploy/cluster-manager/chart/cluster-manager/templates/bootstrap_cluster_role.yaml b/vendor/open-cluster-management.io/ocm/deploy/cluster-manager/chart/cluster-manager/templates/bootstrap_cluster_role.yaml index 0aacd086..eec51cb1 100644 --- a/vendor/open-cluster-management.io/ocm/deploy/cluster-manager/chart/cluster-manager/templates/bootstrap_cluster_role.yaml +++ b/vendor/open-cluster-management.io/ocm/deploy/cluster-manager/chart/cluster-manager/templates/bootstrap_cluster_role.yaml @@ -2,7 +2,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - name: open-cluster-management:bootstrap + name: system:open-cluster-management:bootstrap rules: - apiGroups: - "" diff --git a/vendor/open-cluster-management.io/ocm/deploy/cluster-manager/chart/cluster-manager/templates/bootstrap_cluster_role_binding.yaml b/vendor/open-cluster-management.io/ocm/deploy/cluster-manager/chart/cluster-manager/templates/bootstrap_cluster_role_binding.yaml index b3154505..60a261a3 100644 --- a/vendor/open-cluster-management.io/ocm/deploy/cluster-manager/chart/cluster-manager/templates/bootstrap_cluster_role_binding.yaml +++ b/vendor/open-cluster-management.io/ocm/deploy/cluster-manager/chart/cluster-manager/templates/bootstrap_cluster_role_binding.yaml @@ -2,11 +2,11 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: - name: open-cluster-management:bootstrap:managedcluster + name: cluster-bootstrap roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole - name: open-cluster-management:bootstrap + name: system:open-cluster-management:bootstrap subjects: - kind: Group apiGroup: rbac.authorization.k8s.io diff --git a/vendor/open-cluster-management.io/ocm/deploy/cluster-manager/chart/cluster-manager/templates/bootstrap_sa.yaml b/vendor/open-cluster-management.io/ocm/deploy/cluster-manager/chart/cluster-manager/templates/bootstrap_sa.yaml index 2edf9cf4..f97cda88 100644 --- a/vendor/open-cluster-management.io/ocm/deploy/cluster-manager/chart/cluster-manager/templates/bootstrap_sa.yaml +++ b/vendor/open-cluster-management.io/ocm/deploy/cluster-manager/chart/cluster-manager/templates/bootstrap_sa.yaml @@ -2,6 +2,6 @@ apiVersion: v1 kind: ServiceAccount metadata: - name: agent-registration-bootstrap + name: cluster-bootstrap namespace: {{ .Release.Namespace }} {{- end }} diff --git a/vendor/open-cluster-management.io/ocm/deploy/cluster-manager/chart/cluster-manager/templates/bootstrap_sa_cluster_role_binding.yaml b/vendor/open-cluster-management.io/ocm/deploy/cluster-manager/chart/cluster-manager/templates/bootstrap_sa_cluster_role_binding.yaml index e6f2340c..e299bb38 100644 --- a/vendor/open-cluster-management.io/ocm/deploy/cluster-manager/chart/cluster-manager/templates/bootstrap_sa_cluster_role_binding.yaml +++ b/vendor/open-cluster-management.io/ocm/deploy/cluster-manager/chart/cluster-manager/templates/bootstrap_sa_cluster_role_binding.yaml @@ -2,13 +2,13 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: - name: open-cluster-management:bootstrap:agent-registration + name: cluster-bootstrap-sa roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole - name: open-cluster-management:bootstrap + name: system:open-cluster-management:bootstrap subjects: - kind: ServiceAccount - name: agent-registration-bootstrap + name: cluster-bootstrap namespace: {{ .Release.Namespace }} {{- end }} diff --git a/vendor/open-cluster-management.io/ocm/deploy/cluster-manager/chart/cluster-manager/templates/cluster_manager.yaml b/vendor/open-cluster-management.io/ocm/deploy/cluster-manager/chart/cluster-manager/templates/cluster_manager.yaml index 14172e71..e38bd92c 100644 --- a/vendor/open-cluster-management.io/ocm/deploy/cluster-manager/chart/cluster-manager/templates/cluster_manager.yaml +++ b/vendor/open-cluster-management.io/ocm/deploy/cluster-manager/chart/cluster-manager/templates/cluster_manager.yaml @@ -22,13 +22,17 @@ spec: - system:bootstrap:bootstrap-token-ocmhub {{- end }} {{- if .Values.createBootstrapSA }} - - system:serviceaccount:{{ .Release.Namespace }}:agent-registration-bootstrap + - system:serviceaccount:open-cluster-management:cluster-bootstrap {{- end }} {{- end }} {{- with .Values.clusterManager.registrationConfiguration.featureGates }} featureGates: {{- toYaml . | nindent 6 }} {{- end }} + {{- with .Values.clusterManager.registrationConfiguration.registrationDrivers }} + registrationDrivers: + {{- toYaml . | nindent 6 }} + {{- end }} {{- with .Values.clusterManager.workConfiguration }} workConfiguration: {{- toYaml . | nindent 4 }} diff --git a/vendor/open-cluster-management.io/ocm/deploy/cluster-manager/chart/cluster-manager/templates/cluster_role.yaml b/vendor/open-cluster-management.io/ocm/deploy/cluster-manager/chart/cluster-manager/templates/cluster_role.yaml index 3ba2c25d..4f6dab7b 100644 --- a/vendor/open-cluster-management.io/ocm/deploy/cluster-manager/chart/cluster-manager/templates/cluster_role.yaml +++ b/vendor/open-cluster-management.io/ocm/deploy/cluster-manager/chart/cluster-manager/templates/cluster_role.yaml @@ -10,7 +10,7 @@ rules: - apiGroups: [""] resources: ["serviceaccounts/token"] resourceNames: - - "agent-registration-bootstrap" + - "cluster-bootstrap" verbs: ["get", "create"] - apiGroups: [""] resources: ["pods"]