mirror of
https://github.com/komodorio/helm-dashboard.git
synced 2026-03-24 11:48:04 +00:00
A superfluous rule is added to the ClusterRole upon creation, when the dashboard.allowWriteActions value is set to true. This commit will ensure that only a single rule is created within the ClusterRole, regardless of whether the dashboard.allowWriteActions value is enabled or not. The verbs within this rule will update accordingly.
39 lines
1.1 KiB
YAML
39 lines
1.1 KiB
YAML
{{- if .Values.serviceAccount.create -}}
|
|
apiVersion: v1
|
|
kind: ServiceAccount
|
|
metadata:
|
|
name: {{ include "helm-dashboard.serviceAccountName" . }}
|
|
labels:
|
|
{{- include "helm-dashboard.labels" . | nindent 4 }}
|
|
{{- with .Values.serviceAccount.annotations }}
|
|
annotations:
|
|
{{- toYaml . | nindent 4 }}
|
|
{{- end }}
|
|
{{- end }}
|
|
|
|
---
|
|
kind: ClusterRole
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
metadata:
|
|
name: {{ include "helm-dashboard.serviceAccountName" . }}
|
|
rules:
|
|
- apiGroups: ["*"]
|
|
resources: ["*"]
|
|
{{- if .Values.dashboard.allowWriteActions }}
|
|
verbs: ["get", "list", "watch", "create", "delete", "patch", "update"]
|
|
{{- else }}
|
|
verbs: ["get", "list", "watch"]
|
|
{{- end }}
|
|
---
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
kind: ClusterRoleBinding
|
|
metadata:
|
|
name: {{ include "helm-dashboard.serviceAccountName" . }}
|
|
roleRef:
|
|
apiGroup: rbac.authorization.k8s.io
|
|
kind: ClusterRole
|
|
name: {{ include "helm-dashboard.serviceAccountName" . }}
|
|
subjects:
|
|
- kind: ServiceAccount
|
|
namespace: {{ .Release.Namespace }}
|
|
name: {{ include "helm-dashboard.serviceAccountName" . }} |