Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix yaml upon empty volumeMounts or volumes #855

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions templates/tests/server-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,14 @@ spec:
volumeMounts:
{{- if .Values.server.volumeMounts }}
Copy link

@arve0 arve0 Apr 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could also move the if statement one line up, to make it include the key, in example:

      {{- if .Values.server.volumeMounts }}
      volumeMounts:
          {{- toYaml .Values.server.volumeMounts | nindent 8}}
      {{- end }}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed it now (better late than never)

{{- toYaml .Values.server.volumeMounts | nindent 8}}
{{ else }}
[]
{{- end }}
volumes:
{{- if .Values.server.volumes }}
{{- toYaml .Values.server.volumes | nindent 4}}
{{ else }}
[]
{{- end }}
restartPolicy: Never
{{- end }}
Expand Down