From 354aa9e71a0f4ff969452a64af00103024c3d4de Mon Sep 17 00:00:00 2001 From: Chris Marslender Date: Mon, 7 Oct 2024 13:04:25 -0500 Subject: [PATCH] Better command/args support for init containers (#54) * Better command/args support for init containers * Bump version --- charts/generic/Chart.yaml | 2 +- charts/generic/templates/deployment.yaml | 13 ++++++++++++- charts/generic/values.yaml | 1 + 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/charts/generic/Chart.yaml b/charts/generic/Chart.yaml index b2de34a..01c7213 100644 --- a/charts/generic/Chart.yaml +++ b/charts/generic/Chart.yaml @@ -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 diff --git a/charts/generic/templates/deployment.yaml b/charts/generic/templates/deployment.yaml index 2f39de8..5d4925a 100644 --- a/charts/generic/templates/deployment.yaml +++ b/charts/generic/templates/deployment.yaml @@ -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 }} diff --git a/charts/generic/values.yaml b/charts/generic/values.yaml index 14280c3..0fe54ad 100644 --- a/charts/generic/values.yaml +++ b/charts/generic/values.yaml @@ -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