diff --git a/templates/deployment.yaml b/templates/deployment.yaml index a083270..5d8f478 100644 --- a/templates/deployment.yaml +++ b/templates/deployment.yaml @@ -24,11 +24,15 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} annotations: + {{ if ( not $.Values.passboltEnv.secretName ) }} checksum/sec-env: {{ include (print $.Template.BasePath "/secret-env.yaml") . | sha256sum }} + {{- end }} {{ if ( not $.Values.gpgExistingSecret ) }} checksum/sec-gpg: {{ include (print $.Template.BasePath "/secret-gpg.yaml") . | sha256sum }} {{- end }} + {{ if ( not $.Values.passboltEnv.configMapName ) }} checksum/cm-env: {{ include (print $.Template.BasePath "/configmap-env.yaml") . | sha256sum }} + {{- end }} {{- if and .Values.passboltEnv.plain.PASSBOLT_PLUGINS_JWT_AUTHENTICATION_ENABLED ( not .Values.jwtExistingSecret ) }} checksum/sec-jwt: {{ include (print $.Template.BasePath "/secret-jwt.yaml") . | sha256sum }} {{- end }} @@ -90,9 +94,9 @@ spec: {{- end }} envFrom: - configMapRef: - name: {{ $Name }}-cm-env + name: {{ default (printf "%s-cm-env" $Name) .Values.passboltEnv.configMapName }} - secretRef: - name: {{ $Name }}-sec-env + name: {{ default (printf "%s-sec-env" $Name) .Values.passboltEnv.secretName }} {{- with .Values.passboltEnv.extraEnvFrom }} {{- toYaml . | nindent 12 }} {{- end }} @@ -128,9 +132,9 @@ spec: {{- end }} envFrom: - configMapRef: - name: {{ $Name }}-cm-env + name: {{ default (printf "%s-cm-env" $Name) .Values.passboltEnv.configMapName }} - secretRef: - name: {{ $Name }}-sec-env + name: {{ default (printf "%s-sec-env" $Name) .Values.passboltEnv.secretName }} {{- with .Values.passboltEnv.extraEnvFrom }} {{- toYaml . | nindent 12 }} {{- end }} diff --git a/templates/rbac.yaml b/templates/rbac.yaml index 60a8056..eb70504 100644 --- a/templates/rbac.yaml +++ b/templates/rbac.yaml @@ -16,8 +16,8 @@ rules: resources: [ "configmaps", "secrets" ] resourceNames: - {{ $Name }}-sec-redis-proxy - - {{ $Name }}-cm-env - - {{ $Name }}-sec-env + - {{ default (printf "%s-cm-env" $Name) .Values.passboltEnv.configMapName }} + - {{ default (printf "%s-sec-env" $Name) .Values.passboltEnv.secretName }} - {{ include "passbolt.gpg.secretName" ( dict "name" $Name "Values" $.Values ) }} - {{ include "passbolt.jwt.secretName" ( dict "name" $Name "Values" $.Values ) }} - {{ $Name }}-sec-tls @@ -64,9 +64,9 @@ rules: - apiGroups: [""] resources: [ "configmaps", "secrets" ] resourceNames: - - {{ $Name }}-cm-env + - {{ default (printf "%s-cm-env" $Name) .Values.passboltEnv.configMapName }} - {{ include "passbolt.gpg.secretName" ( dict "name" $Name "Values" $.Values ) }} - - {{ $Name }}-sec-env + - {{ default (printf "%s-sec-env" $Name) .Values.passboltEnv.secretName }} - {{ $Name }}-sec-redis-proxy verbs: ["get", "patch"] --- @@ -112,9 +112,9 @@ rules: - apiGroups: [""] resources: [ "configmaps", "secrets" ] resourceNames: - - {{ $Name }}-cm-env + - {{ default (printf "%s-cm-env" $Name) .Values.passboltEnv.configMapName }} - {{ include "passbolt.jwt.secretName" ( dict "name" $Name "Values" $.Values ) }} - - {{ $Name }}-sec-env + - {{ default (printf "%s-sec-env" $Name) .Values.passboltEnv.secretName }} - {{ $Name }}-sec-redis-proxy verbs: ["get", "patch"] ---