Skip to content

Commit

Permalink
Better command/args support for init containers (#54)
Browse files Browse the repository at this point in the history
* Better command/args support for init containers

* Bump version
  • Loading branch information
cmmarslender authored Oct 7, 2024
1 parent 5077ca8 commit 354aa9e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/generic/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ apiVersion: v2
name: generic
description: A generic helm chart that handles a bunch of common application deploy cases
type: application
version: 1.11.2
version: 1.12.0
13 changes: 12 additions & 1 deletion charts/generic/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,18 @@ spec:
- name: {{ .name }}
image: {{ .image }}
imagePullPolicy: {{ default "IfNotPresent" .imagePullPolicy }}
command: {{ default "" .command }}
{{- if .command }}
command:
{{- range .command }}
- {{ . | quote }}
{{- end }}
{{- end }}
{{- if .args }}
args:
{{- range .args }}
- {{ . | quote }}
{{- end }}
{{- end }}
securityContext:
{{- toYaml $.Values.securityContext | nindent 12 }}
{{- with $.Values.deployment.environment }}
Expand Down
1 change: 1 addition & 0 deletions charts/generic/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ initContainers: []
# image: busybox:1.28
# imagePullPolicy: IfNotPresent
# command: ['sh', '-c', "until nslookup myservice.$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace).svc.cluster.local; do echo waiting for myservice; sleep 2; done"]
# args: ['args', 'moreargs']
# - name: init-mydb
# image: busybox:1.28
# imagePullPolicy: IfNotPresent
Expand Down

0 comments on commit 354aa9e

Please sign in to comment.