Merge pull request #15 from laszlocph/generic-sidecar

Generic sidecar support
This commit is contained in:
Laszlo Fogas
2021-04-28 09:55:45 +02:00
committed by GitHub
5 changed files with 38 additions and 23 deletions
+7 -5
View File
@@ -90,14 +90,16 @@ spec:
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- if .Values.debugSidecarEnabled }}
- name: {{ template "robustName" .Release.Name }}-debug
{{- if .Values.sidecar }}
- name: {{ template "robustName" .Release.Name }}-sidecar
securityContext: *securityContext
image: {{ .Values.debugSidecar.image }}
image: {{ .Values.sidecar.repository }}:{{ .Values.sidecar.tag }}
{{- if .Values.sidecar.command }}
command:
- {{ .Values.debugSidecar.shell }}
- {{ .Values.sidecar.shell }}
- -c
- {{ .Values.debugSidecar.command | quote }}
- {{ .Values.sidecar.command | quote }}
{{- end }}
{{- if or (or (.Values.vars) (.Values.secretEnabled)) .Values.sealedSecrets }}
envFrom: *envFrom
{{- end }}
@@ -1,12 +0,0 @@
suite: test deployment
templates:
- deployment.yaml
- configmap.yaml
tests:
- it: Should add a debug sidecar
set:
debugSidecarEnabled: true
asserts:
- equal:
path: spec.template.spec.containers[1].image
value: debian:stable-slim
@@ -0,0 +1,25 @@
suite: test deployment
templates:
- deployment.yaml
- configmap.yaml
tests:
- it: Should inject a sidecar if one is specified
set:
sidecar:
repository: debian
tag: stable-slim
asserts:
- equal:
path: spec.template.spec.containers[1].image
value: debian:stable-slim
- it: Should inject a debug sidecar with shell and command specified
set:
sidecar:
repository: debian
tag: stable-slim
shell: "/bin/bash"
command: "while true; do sleep 30; done;"
asserts:
- equal:
path: spec.template.spec.containers[1].image
value: debian:stable-slim
-6
View File
@@ -44,12 +44,6 @@ secretEnabled: false
shell: "/bin/sh"
debugSidecarEnabled: false
debugSidecar:
image: debian:stable-slim
shell: "/bin/bash"
command: "while true; do sleep 30; done;"
podDisruptionBudgetEnabled: true
spreadAcrossNodes: false
+6
View File
@@ -9,3 +9,9 @@ fileSecrets:
a
multiline
secret
sidecar:
repository: debian
tag: stable-slim
shell: "/bin/bash"
command: "while true; do sleep 30; done;"