Add hash of files and env vars
This commit is contained in:
		@@ -2,7 +2,7 @@ apiVersion: v2
 | 
			
		||||
name: softplayer-lib-workload
 | 
			
		||||
description: A library to be reused accross softplayer charts
 | 
			
		||||
type: library
 | 
			
		||||
version: 0.1.5
 | 
			
		||||
version: 0.1.6
 | 
			
		||||
maintainers:
 | 
			
		||||
  - name: allanger
 | 
			
		||||
    email: allanger@badhouseplants.net
 | 
			
		||||
 
 | 
			
		||||
@@ -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