{{- if (or (and (ne (.Values.client.enabled | toString) "-") .Values.client.enabled) (and (eq (.Values.client.enabled | toString) "-") .Values.global.enabled)) }} {{- if .Values.client.snapshotAgent.enabled }} apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: {{ template "consul.fullname" . }}-snapshot-agent labels: app: {{ template "consul.name" . }} chart: {{ template "consul.chart" . }} heritage: {{ .Release.Service }} release: {{ .Release.Name }} roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: {{ template "consul.fullname" . }}-snapshot-agent subjects: - kind: ServiceAccount name: {{ template "consul.fullname" . }}-snapshot-agent namespace: {{ .Release.Namespace }} {{- end }} {{- end }}