{{- if and .Values.rbac.create }} --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: {{ template "sidekiq-prometheus-exporter.fullname" . }} labels: {{- include "sidekiq-prometheus-exporter.labels" . | nindent 4 }} rules: - apiGroups: [""] resources: {{- if eq (default "configMapRef" .Values.envFrom.type) "secretRef" }} - "secrets" {{- else }} - "configmap" {{- end }} resourceNames: - {{ .Values.envFrom.name | quote }} verbs: ["get"] {{- end }}