From 61c4addd175d22ac3a373a04cbf5444bb0a0ece9 Mon Sep 17 00:00:00 2001 From: Dominik Pinsel Date: Thu, 19 Oct 2023 15:03:37 +0200 Subject: [PATCH 1/4] feat: add initContainers --- charts/managed-identity-wallet/templates/deployment.yaml | 4 ++++ charts/managed-identity-wallet/values.yaml | 2 ++ 2 files changed, 6 insertions(+) diff --git a/charts/managed-identity-wallet/templates/deployment.yaml b/charts/managed-identity-wallet/templates/deployment.yaml index 9a1aa38ae..2fd5285aa 100644 --- a/charts/managed-identity-wallet/templates/deployment.yaml +++ b/charts/managed-identity-wallet/templates/deployment.yaml @@ -44,6 +44,10 @@ spec: serviceAccountName: {{ include "managed-identity-wallet.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} + initContainers: + {{- if .Values.initContainers }} + {{- include "common.tplvalues.render" (dict "value" .Values.initContainers "context" $) | nindent 8 }} + {{- end }} containers: - name: {{ .Chart.Name }} securityContext: diff --git a/charts/managed-identity-wallet/values.yaml b/charts/managed-identity-wallet/values.yaml index 414099293..e26cc61c0 100644 --- a/charts/managed-identity-wallet/values.yaml +++ b/charts/managed-identity-wallet/values.yaml @@ -107,6 +107,8 @@ affinity: {} # -- PodAnnotation configuration podAnnotations: {} +initContainers: [] + ## @section Managed Identity Wallet Primary Parameters ## miw: From 59254c399573c49ff220e282b5784953eb838306 Mon Sep 17 00:00:00 2001 From: Marco Lecheler Date: Thu, 16 Nov 2023 10:08:46 +0100 Subject: [PATCH 2/4] chore: add initContainer description --- charts/managed-identity-wallet/README.md | 1 + charts/managed-identity-wallet/values.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/charts/managed-identity-wallet/README.md b/charts/managed-identity-wallet/README.md index 95158bb53..a6049357b 100644 --- a/charts/managed-identity-wallet/README.md +++ b/charts/managed-identity-wallet/README.md @@ -97,6 +97,7 @@ See [helm upgrade](https://helm.sh/docs/helm/helm_upgrade/) for command document | ingress.enabled | bool | `false` | Enable ingress controller resource | | ingress.hosts | list | `[]` | Ingress accepted hostnames | | ingress.tls | list | `[]` | Ingress TLS configuration | +| initContainers | list | `[]` | add initContainers to the miw deployment | | keycloak.auth.adminPassword | string | `""` | Keycloak admin password | | keycloak.auth.adminUser | string | `"admin"` | Keycloak admin user | | keycloak.enabled | bool | `true` | Enable to deploy Keycloak | diff --git a/charts/managed-identity-wallet/values.yaml b/charts/managed-identity-wallet/values.yaml index e26cc61c0..626053b7e 100644 --- a/charts/managed-identity-wallet/values.yaml +++ b/charts/managed-identity-wallet/values.yaml @@ -107,6 +107,7 @@ affinity: {} # -- PodAnnotation configuration podAnnotations: {} +# -- add initContainers to the miw deployment initContainers: [] ## @section Managed Identity Wallet Primary Parameters From e67f11f3f6642288d3d251ef5fe31ee2d77dbe65 Mon Sep 17 00:00:00 2001 From: Marco Lecheler Date: Mon, 20 Nov 2023 11:03:48 +0100 Subject: [PATCH 3/4] fix: only template initContainer if present --- charts/managed-identity-wallet/templates/deployment.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/managed-identity-wallet/templates/deployment.yaml b/charts/managed-identity-wallet/templates/deployment.yaml index 2fd5285aa..fb13c4889 100644 --- a/charts/managed-identity-wallet/templates/deployment.yaml +++ b/charts/managed-identity-wallet/templates/deployment.yaml @@ -44,10 +44,10 @@ spec: serviceAccountName: {{ include "managed-identity-wallet.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} + {{- if .Values.initContainers }} initContainers: - {{- if .Values.initContainers }} {{- include "common.tplvalues.render" (dict "value" .Values.initContainers "context" $) | nindent 8 }} - {{- end }} + {{- end }} containers: - name: {{ .Chart.Name }} securityContext: From 43433b315c632c342ee73a07bda91520054f15d5 Mon Sep 17 00:00:00 2001 From: Marco Lecheler Date: Tue, 21 Nov 2023 13:39:14 +0100 Subject: [PATCH 4/4] chore: use tpl instead common to render initContianers As from pmoscode suggested the tpl function can be used with toYaml to avoid the Bitnami common template function. --- charts/managed-identity-wallet/templates/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/managed-identity-wallet/templates/deployment.yaml b/charts/managed-identity-wallet/templates/deployment.yaml index fb13c4889..53a0c54a8 100644 --- a/charts/managed-identity-wallet/templates/deployment.yaml +++ b/charts/managed-identity-wallet/templates/deployment.yaml @@ -46,7 +46,7 @@ spec: {{- toYaml .Values.podSecurityContext | nindent 8 }} {{- if .Values.initContainers }} initContainers: - {{- include "common.tplvalues.render" (dict "value" .Values.initContainers "context" $) | nindent 8 }} + {{- tpl (.Values.initContainers | toYaml) $ | nindent 8 }} {{- end }} containers: - name: {{ .Chart.Name }}