From 13bf2cae504821081b244a74d32a8797b2295bf0 Mon Sep 17 00:00:00 2001 From: Alexander Samusev <41779041+alvicsam@users.noreply.github.com> Date: Tue, 27 Jun 2023 14:32:27 +0200 Subject: [PATCH] Improve initContainers template in common chart (#261) * Improve initContainers template in common chart * add comment --- charts/common/Chart.yaml | 2 +- charts/common/templates/deployment.yaml | 15 +++++++++++---- charts/common/values.yaml | 3 +++ 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/charts/common/Chart.yaml b/charts/common/Chart.yaml index 67e4f26c..777e07ed 100644 --- a/charts/common/Chart.yaml +++ b/charts/common/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: common description: A generic helm chart for Kubernetes type: application -version: 0.6.7 +version: 0.6.8 maintainers: - name: Parity url: https://github.com/paritytech/helm-charts diff --git a/charts/common/templates/deployment.yaml b/charts/common/templates/deployment.yaml index ae00e491..d237c2ef 100644 --- a/charts/common/templates/deployment.yaml +++ b/charts/common/templates/deployment.yaml @@ -40,11 +40,18 @@ spec: serviceAccountName: {{ include "common.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} - {{- if .Values.initContainers}} + {{- if .Values.initContainers }} initContainers: - - name: {{ .Values.initContainers.name }} - image: {{ .Values.initContainers.image }} - command: {{ .Values.initContainers.command }} + {{- range $initContainer := .Values.initContainers }} + - name: {{ $initContainer.name }} + image: {{ $initContainer.image }} + command: + {{- toYaml $initContainer.command | nindent 12 }} + {{- with $initContainer.volumeMounts }} + volumeMounts: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- end }} {{- end }} containers: - name: {{ .Chart.Name }} diff --git a/charts/common/values.yaml b/charts/common/values.yaml index 83fc3aca..ec9bdcc1 100644 --- a/charts/common/values.yaml +++ b/charts/common/values.yaml @@ -48,6 +48,9 @@ imagePullSecrets: [] # - name: init-container # image: busybox:1.28 # command: ['sh', '-c', "sleep 30"] +# volumeMounts: +# - name: name +# mountPath: "/path" ## Service account for the pod to use ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/