Skip to content

0.4.19 breaks multi-service account helm charts #188

@imilchev

Description

@imilchev

Release 0.4.19 is breaking generating helm charts from manifests with >1 service account included in them. The code in 0.4.19 assumes there is only 1 service account to be created by the helm chart which is not always the case. I have a helm chart with 3 service accounts and after running helmify I end up with this serviceaccount.yaml:

{{ if .Values.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
  name: {{ include "mondoo-operator.serviceAccountName" . }}
  labels:
  {{- include "mondoo-operator.labels" . | nindent 4 }}
  {{- with .Values.serviceAccount.annotations }}
  annotations:
    {{- toYaml . | nindent 4 }}
  {{- end }}
automountServiceAccountToken: {{ .Values.serviceAccount.automount }}
{{- end }}
---
{{ if .Values.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
  name: {{ include "mondoo-operator.serviceAccountName" . }}
  labels:
  {{- include "mondoo-operator.labels" . | nindent 4 }}
  {{- with .Values.serviceAccount.annotations }}
  annotations:
    {{- toYaml . | nindent 4 }}
  {{- end }}
automountServiceAccountToken: {{ .Values.serviceAccount.automount }}
{{- end }}
---
{{ if .Values.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
  name: {{ include "mondoo-operator.serviceAccountName" . }}
  labels:
  {{- include "mondoo-operator.labels" . | nindent 4 }}
  {{- with .Values.serviceAccount.annotations }}
  annotations:
    {{- toYaml . | nindent 4 }}
  {{- end }}
automountServiceAccountToken: {{ .Values.serviceAccount.automount }}
{{- end }}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions