From c298510701e84ada523786f5528c0ec9e0e2f453 Mon Sep 17 00:00:00 2001 From: Marco Franssen Date: Mon, 21 Aug 2023 19:38:42 +0200 Subject: [PATCH] Fix initContainers spire-server statefulset (#458) To allow for inplace upgrades of spire-server statefulset we are not allowed to make changes to all fields of the statefulset spec. When bumping from 0.8.1 to the latest version the `initContainers:` field is added in the spec and therefore does not allow for updating the statefulset. This fix prevents the empty initContainers block when bumping from a previous chart version. Signed-off-by: Marco Franssen Co-authored-by: Faisal Memon --- charts/spire/charts/spire-server/templates/statefulset.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/charts/spire/charts/spire-server/templates/statefulset.yaml b/charts/spire/charts/spire-server/templates/statefulset.yaml index ef70c9f..d9fc9a6 100644 --- a/charts/spire/charts/spire-server/templates/statefulset.yaml +++ b/charts/spire/charts/spire-server/templates/statefulset.yaml @@ -48,6 +48,7 @@ spec: shareProcessNamespace: true securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} + {{- if or (gt (len .Values.initContainers) 0) (and .Values.upstreamAuthority.certManager.enabled .Values.upstreamAuthority.certManager.ca.create) }} initContainers: {{- if and .Values.upstreamAuthority.certManager.enabled .Values.upstreamAuthority.certManager.ca.create }} - name: wait @@ -67,6 +68,7 @@ spec: {{- if gt (len .Values.initContainers) 0 }} {{- toYaml .Values.initContainers | nindent 8 }} {{- end }} + {{- end }} containers: - name: {{ .Chart.Name }} securityContext: