Fixing custom command
This commit is contained in:
@@ -33,7 +33,7 @@ spec:
|
|||||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
||||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||||
{{- if .Values.command }}
|
{{- if .Values.command }}
|
||||||
command: ['{{ .Values.shell | default "/bin/sh" }}', {{ .Values.command | quote }}]
|
command: ['{{ .Values.shell | default "/bin/sh" }}', "-c", {{ .Values.command | quote }}]
|
||||||
{{- end }}
|
{{- end }}
|
||||||
envFrom:
|
envFrom:
|
||||||
{{- if .Values.vars }}
|
{{- if .Values.vars }}
|
||||||
|
|||||||
@@ -5,16 +5,16 @@ templates:
|
|||||||
tests:
|
tests:
|
||||||
- it: Should set command
|
- it: Should set command
|
||||||
set:
|
set:
|
||||||
command: "while true; date; sleep 2; done"
|
command: "while true; do date; sleep 2; done"
|
||||||
asserts:
|
asserts:
|
||||||
- equal:
|
- equal:
|
||||||
path: spec.template.spec.containers[0].command
|
path: spec.template.spec.containers[0].command
|
||||||
value: ['/bin/sh', 'while true; date; sleep 2; done']
|
value: ['/bin/sh', '-c', 'while true; do date; sleep 2; done']
|
||||||
- it: Should set shell and command
|
- it: Should set shell and command
|
||||||
set:
|
set:
|
||||||
command: "while true; date; sleep 2; done"
|
command: "while true; do date; sleep 2; done"
|
||||||
shell: "/bin/ash"
|
shell: "/bin/ash"
|
||||||
asserts:
|
asserts:
|
||||||
- equal:
|
- equal:
|
||||||
path: spec.template.spec.containers[0].command
|
path: spec.template.spec.containers[0].command
|
||||||
value: ['/bin/ash', 'while true; date; sleep 2; done']
|
value: ['/bin/ash', '-c','while true; do date; sleep 2; done']
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ image:
|
|||||||
tag: stable-slim
|
tag: stable-slim
|
||||||
|
|
||||||
command: |
|
command: |
|
||||||
while true; date; sleep 2; done
|
while true; do date; sleep 2; done
|
||||||
```
|
```
|
||||||
|
|
||||||
Check the Kubernetes manifest:
|
Check the Kubernetes manifest:
|
||||||
@@ -18,7 +18,7 @@ image:
|
|||||||
tag: stable-slim
|
tag: stable-slim
|
||||||
|
|
||||||
command: |
|
command: |
|
||||||
echo "hello"
|
while true; do date; sleep 2; done
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
helm template my-release onechart/onechart -f values.yaml
|
helm template my-release onechart/onechart -f values.yaml
|
||||||
@@ -33,7 +33,7 @@ image:
|
|||||||
tag: 3.12
|
tag: 3.12
|
||||||
|
|
||||||
command: |
|
command: |
|
||||||
echo "hello"
|
while true; do date; sleep 2; done
|
||||||
shell: "/bin/ash"
|
shell: "/bin/ash"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user