Skip to content

Commit

Permalink
Fix startup script creation if-else flow
Browse files Browse the repository at this point in the history
  • Loading branch information
churnikov committed Oct 13, 2024
1 parent b8ae8fc commit 63b5c51
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions apps/custom-app/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ spec:
{{- range $key, $value := .Values.apps.volumeK8s }}
- name: {{ $key }}
mountPath: /tmp
{{- end }}
{{- end }}
{{- if .Values.appconfig.startupCommand}}
- name: create-startup-script
Expand All @@ -70,7 +71,6 @@ spec:
- name: startup-script
mountPath: /scripts
{{- end}}
{{- end }}
containers:
- name: {{ .Values.appname }}
image: {{ .Values.appconfig.image }}
Expand All @@ -97,24 +97,32 @@ spec:
- all
resources:
{{- toYaml .Values.flavor | nindent 10 }}
{{- if .Values.apps.volumeK8s }}
{{- if or .Values.appconfig.startupCommand .Values.apps.volumeK8s }}
volumeMounts:
{{- end }}
{{- if .Values.apps.volumeK8s }}
{{- range $key, $value := .Values.apps.volumeK8s }}
- name: {{ $key }}
mountPath: {{ $.Values.appconfig.path }}
{{- end }}
{{- end }}
{{- if .Values.appconfig.startupCommand}}
- name: startup-script
mountPath: /scripts
{{- end}}
terminationGracePeriodSeconds: 30
dnsPolicy: ClusterFirst
{{ if .Values.apps.volumeK8s }}
{{ if or .Values.apps.volumeK8s .Values.appconfig.startupCommand }}
volumes:
{{- end }}
{{ if .Values.apps.volumeK8s }}
{{- range $key, $value := .Values.apps.volumeK8s }}
- name: {{ $key }}
persistentVolumeClaim:
claimName: {{ $value.release }}
{{- end }}
{{ end }}
{{- if .Values.appconfig.startupCommand}}
- name: startup-script
emptyDir: { }
- name: startup-script
emptyDir: { }
{{- end}}
{{ end }}

0 comments on commit 63b5c51

Please sign in to comment.