File tree Expand file tree Collapse file tree 6 files changed +78
-5
lines changed
cf-common-test/tests/deployment Expand file tree Collapse file tree 6 files changed +78
-5
lines changed Original file line number Diff line number Diff line change @@ -66,3 +66,39 @@ tests:
6666 - equal :
6767 path : spec.template.metadata.annotations.foo
6868 value : bar
69+
70+ - it : Test checksum/config annotation
71+ values :
72+ - values.yaml
73+ set :
74+ podAnnotations :
75+ foo : bar
76+ configMaps :
77+ config :
78+ enabled : true
79+ data :
80+ alice : bob
81+ asserts :
82+ - equal :
83+ path : spec.template.metadata.annotations
84+ value :
85+ foo : bar
86+ checksum/config : 6d1644995a0e1ef705e43f2f737e6adea7036bfceb82cc3bf468cc411a0ff77b
87+
88+ - it : Test checksum/secret annotation
89+ values :
90+ - values.yaml
91+ set :
92+ podAnnotations :
93+ foo : bar
94+ secrets :
95+ secret :
96+ enabled : true
97+ stringData :
98+ alice : bob
99+ asserts :
100+ - equal :
101+ path : spec.template.metadata.annotations
102+ value :
103+ foo : bar
104+ checksum/secret : 8de97c7e45c17e43f84a9bda5428fe0bdf0be8fe12b99cb928c95a01cacfb85f
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ apiVersion: v2
22appVersion : v0.0.0
33description : Codefresh library chart
44name : cf-common
5- version : 0.0.9
5+ version : 0.0.10
66type : library
77keywords :
88 - codefresh
Original file line number Diff line number Diff line change 22
33Codefresh library chart
44
5- ![ Version: 0.0.9 ] ( https://img.shields.io/badge/Version-0.0.9 -informational?style=flat-square ) ![ Type: library] ( https://img.shields.io/badge/Type-library-informational?style=flat-square ) ![ AppVersion: v0.0.0] ( https://img.shields.io/badge/AppVersion-v0.0.0-informational?style=flat-square )
5+ ![ Version: 0.0.10 ] ( https://img.shields.io/badge/Version-0.0.10 -informational?style=flat-square ) ![ Type: library] ( https://img.shields.io/badge/Type-library-informational?style=flat-square ) ![ AppVersion: v0.0.0] ( https://img.shields.io/badge/AppVersion-v0.0.0-informational?style=flat-square )
66
77## Installing the Chart
88
@@ -18,7 +18,7 @@ Include this chart as a dependency in your `Chart.yaml` e.g.
1818# Chart.yaml
1919dependencies :
2020- name : cf-common
21- version : 0.0.9
21+ version : 0.0.10
2222 repository : https://chartmuseum.codefresh.io/cf-common
2323` ` `
2424
Original file line number Diff line number Diff line change 1+ { {/*
2+ Render checksum annotation
3+ Usage:
4+ */} }
5+ { {- define " cf-common.annotations.podAnnotations" -} }
6+
7+ { {- if .Values.podAnnotations -} }
8+ { {- include " cf-common.tplrender" (dict " Values" .Values.podAnnotations " context" $) | nindent 0 } }
9+ { {- end -} }
10+
11+ { {- $configMapFound := dict -} }
12+ { {- range $configMapIndex , $configMapItem := .Values.configMaps -} }
13+
14+ { {- if $configMapItem .enabled -} }
15+ { {- $_ := set $configMapFound $configMapIndex ( include " cf-common.tplrender" (dict " Values" $configMapItem .data " context" $) | sha256sum) -} }
16+ { {- end -} }
17+
18+ { {- if $configMapFound -} }
19+ { {- printf " checksum/config: %v" (toYaml $configMapFound | sha256sum) | nindent 0 -} }
20+ { {- end -} }
21+
22+ { {- end -} }
23+
24+ { {- $secretFound := dict -} }
25+ { {- range $secretIndex , $secretItem := .Values.secrets -} }
26+
27+ { {- if $secretItem .enabled -} }
28+ { {- $_ := set $secretFound $secretIndex ( include " cf-common.tplrender" (dict " Values" $secretItem .stringData " context" $) | sha256sum) -} }
29+ { {- end -} }
30+
31+ { {- if $secretFound -} }
32+ { {- printf " checksum/secret: %v" (toYaml $secretFound | sha256sum) | nindent 0 -} }
33+ { {- end -} }
34+
35+ { {- end -} }
36+
37+ { {- end -} }
Original file line number Diff line number Diff line change 5151 { {- if .Values.podLabels } }
5252 { {- include " cf-common.tplrender" (dict " Values" .Values.podLabels " context" $) | nindent 8 } }
5353 { {- end } }
54- { {- if .Values .podAnnotations } }
54+ { {- with include " cf-common.annotations .podAnnotations" . } }
5555 annotations:
56- { {- include " cf-common.tplrender " (dict " Values " .Values.podAnnotations " context " $) | nindent 8 } }
56+ { {- . | nindent 8} }
5757 { {- end } }
5858 spec: { {- include " cf-common.controller.pod" . | trim | nindent 6 -} }
5959{ {- end -} }
File renamed without changes.
You can’t perform that action at this time.
0 commit comments