Fixing custom command

This commit is contained in:
Laszlo Fogas
2020-10-14 09:20:12 +02:00
parent 7c6d6ee8e6
commit 5d929320a5
3 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ spec:
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if .Values.command }}
command: ['{{ .Values.shell | default "/bin/sh" }}', {{ .Values.command | quote }}]
command: ['{{ .Values.shell | default "/bin/sh" }}', "-c", {{ .Values.command | quote }}]
{{- end }}
envFrom:
{{- if .Values.vars }}
+4 -4
View File
@@ -5,16 +5,16 @@ templates:
tests:
- it: Should set command
set:
command: "while true; date; sleep 2; done"
command: "while true; do date; sleep 2; done"
asserts:
- equal:
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
set:
command: "while true; date; sleep 2; done"
command: "while true; do date; sleep 2; done"
shell: "/bin/ash"
asserts:
- equal:
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']
+3 -3
View File
@@ -6,7 +6,7 @@ image:
tag: stable-slim
command: |
while true; date; sleep 2; done
while true; do date; sleep 2; done
```
Check the Kubernetes manifest:
@@ -18,7 +18,7 @@ image:
tag: stable-slim
command: |
echo "hello"
while true; do date; sleep 2; done
EOF
helm template my-release onechart/onechart -f values.yaml
@@ -33,7 +33,7 @@ image:
tag: 3.12
command: |
echo "hello"
while true; do date; sleep 2; done
shell: "/bin/ash"
EOF