From e9bbdc37466c2870dd33bc9b8c5b90c9fa951a38 Mon Sep 17 00:00:00 2001 From: 2005wind <2005wind@gmail.com> Date: Wed, 24 Jul 2024 11:26:10 +0800 Subject: [PATCH] fix including-space issue in the rbac name (#156) --- chart/operator/templates/rbac.yaml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/chart/operator/templates/rbac.yaml b/chart/operator/templates/rbac.yaml index 5038697..9d6b265 100644 --- a/chart/operator/templates/rbac.yaml +++ b/chart/operator/templates/rbac.yaml @@ -60,7 +60,7 @@ rules: apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - name: skywalking-swck-manager-role + name: {{ include "operator.fullname" . | trunc (int (sub 63 (len "-manager-role"))) | printf "%s-manager-role" }} rules: - apiGroups: - certificates.k8s.io @@ -459,7 +459,7 @@ rules: apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: - name: {{ include "operator.fullname" . | trunc (int (sub 63 (len "-leader-election-role"))) | printf "%s-leader-election-role" }} binding + name: {{ include "operator.fullname" . | trunc (int (sub 63 (len "-leader-election-role"))) | printf "%s-leader-election-role" }}binding namespace: {{ .Release.Namespace }} roleRef: apiGroup: rbac.authorization.k8s.io @@ -473,7 +473,7 @@ subjects: apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: - name: {{ include "operator.fullname" . | trunc (int (sub 63 (len "-manager-role"))) | printf "%s-manager-role" }} binding + name: {{ include "operator.fullname" . | trunc (int (sub 63 (len "-manager-role"))) | printf "%s-manager-role" }}binding roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole @@ -492,6 +492,19 @@ roleRef: kind: ClusterRole name: {{ include "operator.fullname" . | trunc (int (sub 63 (len "-proxy-role"))) | printf "%s-proxy-role" }} subjects: +- kind: ServiceAccount + name: {{ include "operator.fullname" . | trunc (int (sub 63 (len "-controller-manager"))) | printf "%s-controller-manager" }} + namespace: {{ .Release.Namespace }} +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ include "operator.fullname" . | trunc (int (sub 63 (len "-metrics-reader"))) | printf "%s-metrics-reader" }}-rolebinding +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ include "operator.fullname" . | trunc (int (sub 63 (len "-metrics-reader"))) | printf "%s-metrics-reader" }} +subjects: - kind: ServiceAccount name: {{ include "operator.fullname" . | trunc (int (sub 63 (len "-controller-manager"))) | printf "%s-controller-manager" }} namespace: {{ .Release.Namespace }} \ No newline at end of file