Add hash of files and env vars
This commit is contained in:
@ -2,6 +2,15 @@
|
||||
This is a builder for deployments
|
||||
*/}}
|
||||
|
||||
{{- define "lib.metadata.hash" -}} {{- /* (define) */ -}}
|
||||
{{- range $k, $v := .Env -}} {{- /* (1) */ -}}
|
||||
{{ printf "softplayer.net/env/%s" $k }}: {{ $v.data | toString | sha256sum }}
|
||||
{{ end -}} {{/* /(1) */}}
|
||||
{{- range $k, $v := .Files -}} {{- /* (1) */ -}}
|
||||
{{ printf "softplayer.net/files/%s" $k }}: {{ $v.data | toString | sha256sum }}
|
||||
{{ end }} {{/* /(1) */}}
|
||||
{{- end -}} {{- /* /(define) */ -}}
|
||||
|
||||
{{- define "deployment.spec" }} {{- /* (define) */}}
|
||||
# ---------------------------------------------------------------------
|
||||
# The spec is build within the helm library
|
||||
@ -21,6 +30,8 @@ template:
|
||||
metadata:
|
||||
labels:
|
||||
{{- include "metadata.labels" . | nindent 6 }}
|
||||
annotations:
|
||||
{{- include "lib.metadata.hash" (dict "Env" $.Values.env "Files" $.Values.files) | nindent 6 }}
|
||||
spec:
|
||||
{{- include "helper.workload.securityContext" . | nindent 4 -}}
|
||||
{{- include "helper.deployment.volumes" . | nindent 4 }}
|
||||
|
Reference in New Issue
Block a user