fix(template): Don't print empty lists

This commit is contained in:
2024-09-04 14:15:53 +02:00
parent b8a623257b
commit 7097564a72
2 changed files with 12 additions and 4 deletions
+9 -1
View File
@@ -58,12 +58,16 @@ spec:
- name: {{ .name }}
value: {{ tpl (quote .value) $ }}
{{- end }}
{{- if or .Values.application.isSpring .Values.volumeMounts }}
volumeMounts:
{{- if .Values.application.isSpring }}
- mountPath: /tmp
name: tmp
{{- end }}
{{- toYaml .Values.volumeMounts | nindent 12 }}
{{- if .Values.volumeMounts }}
{{- toYaml .Values.volumeMounts | nindent 12 }}
{{- end }}
{{- end }}
ports:
- name: http
containerPort: {{ .Values.application.port }}
@@ -117,13 +121,17 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if or .Values.application.isSpring .Values.volumes }}
volumes:
{{- if .Values.application.isSpring }}
- name: tmp
emptyDir:
medium: Memory
{{- end }}
{{- if .Values.volumes }}
{{- toYaml .Values.volumes | nindent 8 }}
{{- end }}
{{- end }}
{{- with .Values.podSpec }}
{{- toYaml . | nindent 6 }}
{{- end }}