File tree Expand file tree Collapse file tree 6 files changed +53
-6
lines changed
cf-common-test/tests/deployment Expand file tree Collapse file tree 6 files changed +53
-6
lines changed Original file line number Diff line number Diff line change @@ -234,3 +234,16 @@ tests:
234234 - equal :
235235 path : spec.template.spec.containers[0].image
236236 value : myregistry.io/codefresh/cf-api:master
237+
238+ # For backward compatibility (onprem with private docker registry)
239+ - it : Test main container with legacy var structure for image
240+ values :
241+ - values.yaml
242+ set :
243+ image : codefresh/cf-api
244+ dockerRegistry : gcr.io/codefresh-enterprise/
245+ imageTag : latest
246+ asserts :
247+ - equal :
248+ path : spec.template.spec.containers[0].image
249+ value : gcr.io/codefresh-enterprise/codefresh/cf-api:latest
Original file line number Diff line number Diff line change @@ -48,6 +48,22 @@ tests:
4848 path : spec.template.spec.imagePullSecrets
4949 count : 2
5050
51+ - it : Test deployment TPL imagePullSecrets
52+ release :
53+ name : cf
54+ values :
55+ - values.yaml
56+ set :
57+ global :
58+ pullSecretName : ecr-codefresh
59+ imagePullSecrets :
60+ - " {{ .Release.Name }}-{{ .Values.global.pullSecretName }}-registry"
61+ asserts :
62+ - contains :
63+ path : spec.template.spec.imagePullSecrets
64+ content :
65+ name : cf-ecr-codefresh-registry
66+
5167 - it : Test deployment's initContainer is present and valid
5268 values :
5369 - values.yaml
Original file line number Diff line number Diff line change 44 - global-pull-secret
55 volumeName : some-existing-volume
66
7-
87imagePullSecrets :
98 - my-pull-secret
109
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.5
5+ version : 0.0.6
66type : library
77keywords :
88 - codefresh
Original file line number Diff line number Diff line change 22
33Codefresh library chart
44
5- ![ Version: 0.0.5 ] ( https://img.shields.io/badge/Version-0.0.5 -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.6 ] ( https://img.shields.io/badge/Version-0.0.6 -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.5
21+ version : 0.0.6
2222 repository : https://chartmuseum.codefresh.io/cf-common
2323` ` `
2424
Original file line number Diff line number Diff line change @@ -27,6 +27,25 @@ For backward compatibility (onprem with private docker registry)
2727 { {- end -} }
2828{ {- end -} }
2929
30+ { {- /*
31+ For backward compatibility with legacy var struct
32+ e.g.:
33+ cf-api:
34+ enabled: true
35+ image: codefresh/cf-api
36+ dockerRegistry: gcr.io/codefresh-enterprise/
37+ imageTag: latest
38+ */} }
39+ { {- if $.Values.dockerRegistry -} }
40+ { {- $registryName = $.Values.dockerRegistry | trimSuffix " /" -} }
41+ { {- end -} }
42+ { {- if $.Values.image -} }
43+ { {- $repositoryName = $.Values.image -} }
44+ { {- end -} }
45+ { {- if $.Values.imageTag -} }
46+ { {- $imageTag = $.Values.imageTag | toString -} }
47+ { {- end -} }
48+
3049{ {- printf " %s/%s:%s" $registryName $repositoryName $imageTag -} }
3150
3251{ {- end -} }
4665 { {- end -} }
4766
4867 { {- range .Values.global.imagePullSecrets -} }
49- { {- $pullSecrets = append $pullSecrets . -} }
68+ { {- $pullSecrets = append $pullSecrets ( include " cf-common.tplrender " (dict " Values " . " context " $)) -} }
5069 { {- end -} }
5170 { {- end -} }
5271
5675 { {- end -} }
5776
5877 { {- range .Values.imagePullSecrets -} }
59- { {- $pullSecrets = append $pullSecrets . -} }
78+ { {- $pullSecrets = append $pullSecrets ( include " cf-common.tplrender " (dict " Values " . " context " $)) -} }
6079 { {- end -} }
6180 { {- end -} }
6281
You can’t perform that action at this time.
0 commit comments