{{- if .Values.serviceAccount.create -}} apiVersion: v1 kind: ServiceAccount metadata: {{- $_ := set . "serviceAccount" .Values.serviceAccount }} name: {{ include "otel-demo.serviceAccountName" . }} labels: {{- include "otel-demo.labels" . | nindent 4 }} {{- if .Values.serviceAccount.annotations }} annotations: {{- range $key, $value := .Values.serviceAccount.annotations }} {{- printf "%s: %s" $key (tpl $value $ | quote) | nindent 4 }} {{- end }} {{- end }} {{- end }}