diff --git a/helm/template/Chart.yaml b/helm/template/Chart.yaml index de7fb01..5f6353a 100644 --- a/helm/template/Chart.yaml +++ b/helm/template/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: template description: A Helm library chart containing common templates, keeping application templates short type: library -version: 0.2.1 +version: 0.2.2 maintainers: - name: Jim Martens url: https://2martens.de @@ -11,7 +11,7 @@ sources: annotations: artifacthub.io/changes: | - kind: fixed - description: No longer necessary to populate secrets value if vault is enabled. + description: Fixed path to secret when using vault artifacthub.io/signKey: | fingerprint: F0F153B65BAD467201D7544E47393ABD1F96B7C8 url: https://mafiasi.de/pks/key/47393ABD1F96B7C8.asc diff --git a/helm/template/templates/_deployment.yaml b/helm/template/templates/_deployment.yaml index b2a6de7..8c577cd 100644 --- a/helm/template/templates/_deployment.yaml +++ b/helm/template/templates/_deployment.yaml @@ -41,11 +41,16 @@ spec: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default "latest" }}" imagePullPolicy: {{ .Values.image.pullPolicy }} - {{- if or .Values.secrets .Values.vault.enabled }} + {{- if and .Values.secrets (not .Values.vault.enabled) }} envFrom: - secretRef: name: {{ include "template.fullname" . }} {{- end }} + {{- if .Values.vault.enabled }} + envFrom: + - secretRef: + name: {{ .Values.vault.operatorNamespace | default "vault-secrets-operator-system" }}/{{ include "template.fullname" . }} + {{- end }} env: {{- if .Values.application.isSpring }} - name: SPRING_PROFILES_ACTIVE diff --git a/helm/template/templates/_vault-secrets-app.yaml b/helm/template/templates/_vault-secrets-app.yaml index fefdc71..16eb65d 100644 --- a/helm/template/templates/_vault-secrets-app.yaml +++ b/helm/template/templates/_vault-secrets-app.yaml @@ -4,7 +4,7 @@ apiVersion: secrets.hashicorp.com/v1beta1 kind: HCPVaultSecretsApp metadata: name: {{ include "template.fullname" . }} - namespace: {{ .Release.Namespace }} + namespace: {{ .Values.vault.operatorNamespace | default "vault-secrets-operator-system" }} labels: {{- include "template.labels" . | nindent 4 }} spec: