{{- $syncEnabled := (or (and (ne (.Values.syncCatalog.enabled | toString) "-") .Values.syncCatalog.enabled) (and (eq (.Values.syncCatalog.enabled | toString) "-") .Values.global.enabled)) }} {{- if $syncEnabled }} apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: {{ template "consul.fullname" . }}-sync-catalog 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" . }}-sync-catalog subjects: - kind: ServiceAccount name: {{ template "consul.fullname" . }}-sync-catalog namespace: {{ .Release.Namespace }} {{- end }}