{{- if (or (and (ne (.Values.client.enabled | toString) "-") .Values.client.enabled) (and (eq (.Values.client.enabled | toString) "-") .Values.global.enabled)) }} apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: {{ template "consul.fullname" . }}-client namespace: {{ .Release.Namespace }} labels: app: {{ template "consul.name" . }} chart: {{ template "consul.chart" . }} heritage: {{ .Release.Service }} release: {{ .Release.Name }} component: client {{- if (or .Values.global.acls.manageSystemACLs .Values.global.enablePodSecurityPolicies .Values.global.openshift.enabled) }} rules: {{- if .Values.global.enablePodSecurityPolicies }} - apiGroups: ["policy"] resources: ["podsecuritypolicies"] resourceNames: - {{ template "consul.fullname" . }}-client verbs: - use {{- end }} {{- if .Values.global.acls.manageSystemACLs }} - apiGroups: [""] resources: - secrets resourceNames: - {{ template "consul.fullname" . }}-client-acl-token verbs: - get {{- end }} {{- if .Values.global.openshift.enabled}} - apiGroups: ["security.openshift.io"] resources: ["securitycontextconstraints"] resourceNames: - {{ template "consul.fullname" . }}-client verbs: - use {{- end}} {{- else}} rules: [] {{- end }} {{- end }}