Skip to content

Commit

Permalink
feat: add a default value for secets and configmap refs
Browse files Browse the repository at this point in the history
  • Loading branch information
thamudi committed Oct 6, 2024
1 parent 7d1c052 commit 6cb0ae0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
12 changes: 8 additions & 4 deletions templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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 }}
Expand Down Expand Up @@ -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 }}
Expand Down
12 changes: 6 additions & 6 deletions templates/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"]
---
Expand Down Expand Up @@ -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"]
---
Expand Down

0 comments on commit 6cb0ae0

Please sign in to comment.