django-DefectDojo icon indicating copy to clipboard operation
django-DefectDojo copied to clipboard

Helm chart cannot be rendered anymore with extraEnv set.

Open Brawdunoir opened this issue 1 year ago • 0 comments

Bug description I cannot render anymore the helm chart with a non-empty extraEnv value in the values.yaml.

extraEnv:
    - name: Foo
      value: "Bar"
Error: YAML parse error on defectdojo/templates/celery-beat-deployment.yaml: error converting YAML to JSON: yaml: line 55: did not find expected key

I narrowed down to the culprit and it is the nindent 8 in the dbMigrationChecker helper added in #10454. Putting nindent 2 instead solves the issue.

{{/*
  Define db-migration-checker
*/}}
{{- define "dbMigrationChecker" -}}
- name: db-migration-checker
  ...
  env:
  ...
  {{- if .Values.extraEnv }}
  {{- toYaml .Values.extraEnv | nindent 8 }} <----- here
  {{- end }}
...
{{- end -}}

Chart version 1.6.146

I will submit a PR to address the issue.

Brawdunoir avatar Aug 20 '24 17:08 Brawdunoir