X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=depRicKubernetesOperator%2Finternal%2Fcontroller%2FgetClusterRole.go;fp=depRicKubernetesOperator%2Finternal%2Fcontroller%2FgetClusterRole.go;h=13a82001484b724be956831eddf646d9c7ac71fc;hb=6ab3aec83c11229354656c0fff7d047e833fa936;hp=31e1bb4fea303ad07f66c15bd93831e8d0bfedb6;hpb=59cb9a18cc92a65c002ba1c516c08a0e5ece4103;p=ric-plt%2Fric-dep.git diff --git a/depRicKubernetesOperator/internal/controller/getClusterRole.go b/depRicKubernetesOperator/internal/controller/getClusterRole.go index 31e1bb4..13a8200 100644 --- a/depRicKubernetesOperator/internal/controller/getClusterRole.go +++ b/depRicKubernetesOperator/internal/controller/getClusterRole.go @@ -3,6 +3,7 @@ package controller import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + rbacv1 "k8s.io/api/rbac/v1" ) func GetClusterRole() []*rbacv1.ClusterRole { @@ -102,6 +103,273 @@ func GetClusterRole() []*rbacv1.ClusterRole { }, } - return []*rbacv1.ClusterRole{clusterRole1, clusterRole2} + clusterRole3 := &rbacv1.ClusterRole{ + ObjectMeta: metav1.ObjectMeta{ + Labels: map[string]string{ + "app.kubernetes.io/version": "1.4", + "helm.sh/chart": "kong-0.36.6", + "app.kubernetes.io/instance": "release-name", + "app.kubernetes.io/managed-by": "Helm", + "app.kubernetes.io/name": "kong", + }, + Name: "release-name-kong", + }, + Rules: []rbacv1.PolicyRule{ + + rbacv1.PolicyRule{ + Resources: []string{ + + "endpoints", + "nodes", + "pods", + "secrets", + }, + Verbs: []string{ + + "list", + "watch", + }, + APIGroups: []string{ + + "", + }, + }, + rbacv1.PolicyRule{ + APIGroups: []string{ + + "", + }, + Resources: []string{ + + "nodes", + }, + Verbs: []string{ + + "get", + }, + }, + rbacv1.PolicyRule{ + APIGroups: []string{ + + "", + }, + Resources: []string{ + + "services", + }, + Verbs: []string{ + + "get", + "list", + "watch", + }, + }, + rbacv1.PolicyRule{ + APIGroups: []string{ + + "extensions", + "networking.k8s.io", + }, + Resources: []string{ + + "ingresses", + }, + Verbs: []string{ + + "get", + "list", + "watch", + }, + }, + rbacv1.PolicyRule{ + APIGroups: []string{ + + "", + }, + Resources: []string{ + + "events", + }, + Verbs: []string{ + + "create", + "patch", + }, + }, + rbacv1.PolicyRule{ + APIGroups: []string{ + + "extensions", + "networking.k8s.io", + }, + Resources: []string{ + + "ingresses/status", + }, + Verbs: []string{ + + "update", + }, + }, + rbacv1.PolicyRule{ + Verbs: []string{ + + "get", + "list", + "watch", + }, + APIGroups: []string{ + + "configuration.konghq.com", + }, + Resources: []string{ + + "kongplugins", + "kongcredentials", + "kongconsumers", + "kongingresses", + }, + }, + }, + TypeMeta: metav1.TypeMeta{ + APIVersion: "rbac.authorization.k8s.io/v1", + Kind: "ClusterRole", + }, + } + + clusterRole4 := &rbacv1.ClusterRole{ + ObjectMeta: metav1.ObjectMeta{ + Labels: map[string]string{ + "app.kubernetes.io/managed-by": "Helm", + "app.kubernetes.io/name": "kong", + "app.kubernetes.io/version": "1.4", + "helm.sh/chart": "kong-0.36.6", + "app.kubernetes.io/instance": "release-name", + }, + Name: "release-name-kong", + }, + Rules: []rbacv1.PolicyRule{ + + rbacv1.PolicyRule{ + APIGroups: []string{ + + "", + }, + Resources: []string{ + + "endpoints", + "nodes", + "pods", + "secrets", + }, + Verbs: []string{ + + "list", + "watch", + }, + }, + rbacv1.PolicyRule{ + Resources: []string{ + + "nodes", + }, + Verbs: []string{ + + "get", + }, + APIGroups: []string{ + + "", + }, + }, + rbacv1.PolicyRule{ + Verbs: []string{ + + "get", + "list", + "watch", + }, + APIGroups: []string{ + + "", + }, + Resources: []string{ + + "services", + }, + }, + rbacv1.PolicyRule{ + APIGroups: []string{ + + "extensions", + "networking.k8s.io", + }, + Resources: []string{ + + "ingresses", + }, + Verbs: []string{ + + "get", + "list", + "watch", + }, + }, + rbacv1.PolicyRule{ + Resources: []string{ + + "events", + }, + Verbs: []string{ + + "create", + "patch", + }, + APIGroups: []string{ + + "", + }, + }, + rbacv1.PolicyRule{ + APIGroups: []string{ + + "extensions", + "networking.k8s.io", + }, + Resources: []string{ + + "ingresses/status", + }, + Verbs: []string{ + + "update", + }, + }, + rbacv1.PolicyRule{ + APIGroups: []string{ + + "configuration.konghq.com", + }, + Resources: []string{ + + "kongplugins", + "kongcredentials", + "kongconsumers", + "kongingresses", + }, + Verbs: []string{ + + "get", + "list", + "watch", + }, + }, + }, + TypeMeta: metav1.TypeMeta{ + APIVersion: "rbac.authorization.k8s.io/v1", + Kind: "ClusterRole", + }, + } + return []*rbacv1.ClusterRole{clusterRole1, clusterRole2, clusterRole3, clusterRole4} } \ No newline at end of file