From 2006c4ed4bc03587bfecff8c6ca5e68941a49173 Mon Sep 17 00:00:00 2001 From: liuwei Date: Thu, 11 Mar 2021 09:05:03 +0800 Subject: [PATCH] update rolebinding name Signed-off-by: liuwei --- pkg/hub/managedcluster/bindata/bindata.go | 4 ++-- .../manifests/managedcluster-registration-rolebinding.yaml | 2 +- .../manifests/managedcluster-work-rolebinding.yaml | 2 +- test/integration/managedcluster_deletiong_test.go | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/hub/managedcluster/bindata/bindata.go b/pkg/hub/managedcluster/bindata/bindata.go index 590823690..7a4e29262 100644 --- a/pkg/hub/managedcluster/bindata/bindata.go +++ b/pkg/hub/managedcluster/bindata/bindata.go @@ -150,7 +150,7 @@ func pkgHubManagedclusterManifestsManagedclusterNamespaceYaml() (*asset, error) var _pkgHubManagedclusterManifestsManagedclusterRegistrationRolebindingYaml = []byte(`apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: - name: {{ .ManagedClusterName }}:managed-cluster-registration + name: open-cluster-management:managedcluster:{{ .ManagedClusterName }}:registration namespace: {{ .ManagedClusterName }} roleRef: apiGroup: rbac.authorization.k8s.io @@ -182,7 +182,7 @@ func pkgHubManagedclusterManifestsManagedclusterRegistrationRolebindingYaml() (* var _pkgHubManagedclusterManifestsManagedclusterWorkRolebindingYaml = []byte(`apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: - name: {{ .ManagedClusterName }}:managed-cluster-work + name: open-cluster-management:managedcluster:{{ .ManagedClusterName }}:work namespace: {{ .ManagedClusterName }} finalizers: - cluster.open-cluster-management.io/manifest-work-cleanup diff --git a/pkg/hub/managedcluster/manifests/managedcluster-registration-rolebinding.yaml b/pkg/hub/managedcluster/manifests/managedcluster-registration-rolebinding.yaml index 8a4c961e2..ca1194d44 100644 --- a/pkg/hub/managedcluster/manifests/managedcluster-registration-rolebinding.yaml +++ b/pkg/hub/managedcluster/manifests/managedcluster-registration-rolebinding.yaml @@ -1,7 +1,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: - name: {{ .ManagedClusterName }}:managed-cluster-registration + name: open-cluster-management:managedcluster:{{ .ManagedClusterName }}:registration namespace: {{ .ManagedClusterName }} roleRef: apiGroup: rbac.authorization.k8s.io diff --git a/pkg/hub/managedcluster/manifests/managedcluster-work-rolebinding.yaml b/pkg/hub/managedcluster/manifests/managedcluster-work-rolebinding.yaml index c5273ccdb..f9875740b 100644 --- a/pkg/hub/managedcluster/manifests/managedcluster-work-rolebinding.yaml +++ b/pkg/hub/managedcluster/manifests/managedcluster-work-rolebinding.yaml @@ -1,7 +1,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: - name: {{ .ManagedClusterName }}:managed-cluster-work + name: open-cluster-management:managedcluster:{{ .ManagedClusterName }}:work namespace: {{ .ManagedClusterName }} finalizers: - cluster.open-cluster-management.io/manifest-work-cleanup diff --git a/test/integration/managedcluster_deletiong_test.go b/test/integration/managedcluster_deletiong_test.go index 49464ed4c..c064224b8 100644 --- a/test/integration/managedcluster_deletiong_test.go +++ b/test/integration/managedcluster_deletiong_test.go @@ -48,7 +48,7 @@ var _ = ginkgo.Describe("Cluster deleting", func() { err = clusterClient.ClusterV1().ManagedClusters().Delete(context.Background(), managedCluster.Name, metav1.DeleteOptions{}) gomega.Expect(err).NotTo(gomega.HaveOccurred()) - roleBindingName := fmt.Sprintf("%s:managed-cluster-work", managedCluster.Name) + roleBindingName := fmt.Sprintf("open-cluster-management:managedcluster:%s:work", managedCluster.Name) err = kubeClient.RbacV1().RoleBindings(managedCluster.Name).Delete(context.Background(), roleBindingName, metav1.DeleteOptions{}) gomega.Expect(err).NotTo(gomega.HaveOccurred())