{{- $serverEnabled := (or (and (ne (.Values.server.enabled | toString) "-") .Values.server.enabled) (and (eq (.Values.server.enabled | toString) "-") .Values.global.enabled)) -}} {{- if (or $serverEnabled .Values.externalServers.enabled) }} {{- if .Values.global.acls.manageSystemACLs }} apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: {{ template "consul.fullname" . }}-server-acl-init-cleanup namespace: {{ .Release.Namespace }} labels: app: {{ template "consul.name" . }} chart: {{ template "consul.chart" . }} heritage: {{ .Release.Service }} release: {{ .Release.Name }} component: server-acl-init-cleanup roleRef: apiGroup: rbac.authorization.k8s.io kind: Role name: {{ template "consul.fullname" . }}-server-acl-init-cleanup subjects: - kind: ServiceAccount name: {{ template "consul.fullname" . }}-server-acl-init-cleanup {{- end }} {{- end }}