From: Thoralf Czichy Date: Thu, 7 Dec 2023 09:39:02 +0000 (+0000) Subject: Merge "Adding Cluster Role Binding for RIC." X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=d8123116713107bfaf267a40ebf0faefac3a3fa0;hp=5f88ed0e83e3e2733f3b3553b2a0dabc1da14454;p=ric-plt%2Fric-dep.git Merge "Adding Cluster Role Binding for RIC." --- diff --git a/depRicKubernetesOperator/internal/controller/getClusterRoleBinding.go b/depRicKubernetesOperator/internal/controller/getClusterRoleBinding.go index 5412f74..3a83424 100644 --- a/depRicKubernetesOperator/internal/controller/getClusterRoleBinding.go +++ b/depRicKubernetesOperator/internal/controller/getClusterRoleBinding.go @@ -7,6 +7,7 @@ import ( ) func GetClusterRoleBinding() []*rbacv1.ClusterRoleBinding { + clusterRoleBinding1 := &rbacv1.ClusterRoleBinding{ TypeMeta: metav1.TypeMeta{ APIVersion: "rbac.authorization.k8s.io/v1", @@ -54,5 +55,66 @@ func GetClusterRoleBinding() []*rbacv1.ClusterRoleBinding { Kind: "ClusterRoleBinding", }, } - return []*rbacv1.ClusterRoleBinding{clusterRoleBinding1, clusterRoleBinding2} + + clusterRoleBinding3 := &rbacv1.ClusterRoleBinding{ + RoleRef: rbacv1.RoleRef{ + APIGroup: "rbac.authorization.k8s.io", + Kind: "ClusterRole", + Name: "release-name-kong", + }, + Subjects: []rbacv1.Subject{ + + rbacv1.Subject{ + Namespace: "ricplt", + Kind: "ServiceAccount", + Name: "release-name-kong", + }, + }, + TypeMeta: metav1.TypeMeta{ + APIVersion: "rbac.authorization.k8s.io/v1", + Kind: "ClusterRoleBinding", + }, + ObjectMeta: metav1.ObjectMeta{ + Labels: map[string]string{ + "helm.sh/chart": "kong-0.36.6", + "app.kubernetes.io/instance": "release-name", + "app.kubernetes.io/managed-by": "Helm", + "app.kubernetes.io/name": "kong", + "app.kubernetes.io/version": "1.4", + }, + Name: "release-name-kong", + }, + } + + clusterRoleBinding4 := &rbacv1.ClusterRoleBinding{ + Subjects: []rbacv1.Subject{ + + rbacv1.Subject{ + Kind: "ServiceAccount", + Name: "release-name-kong", + Namespace: "ricplt", + }, + }, + TypeMeta: metav1.TypeMeta{ + APIVersion: "rbac.authorization.k8s.io/v1", + Kind: "ClusterRoleBinding", + }, + ObjectMeta: metav1.ObjectMeta{ + Labels: map[string]string{ + "app.kubernetes.io/instance": "release-name", + "app.kubernetes.io/managed-by": "Helm", + "app.kubernetes.io/name": "kong", + "app.kubernetes.io/version": "1.4", + "helm.sh/chart": "kong-0.36.6", + }, + Name: "release-name-kong", + }, + RoleRef: rbacv1.RoleRef{ + Name: "release-name-kong", + APIGroup: "rbac.authorization.k8s.io", + Kind: "ClusterRole", + }, + } + + return []*rbacv1.ClusterRoleBinding{clusterRoleBinding1, clusterRoleBinding2, clusterRoleBinding3, clusterRoleBinding4} }