File tree Expand file tree Collapse file tree 4 files changed +27
-11
lines changed
cf-common-test/tests/deployment Expand file tree Collapse file tree 4 files changed +27
-11
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,23 @@ tests:
6060 path : spec.template.spec.containers[0].env[0].value
6161 value : BOB
6262
63+ # For backward compatibility
64+ - it : Test .Values.env precedence over .Values.container.env
65+ values :
66+ - values.yaml
67+ set :
68+ container :
69+ env :
70+ SERVICE_ROLE : all
71+ env :
72+ SERVICE_ROLE : internal
73+ asserts :
74+ - contains :
75+ path : spec.template.spec.containers[0].env
76+ content :
77+ name : SERVICE_ROLE
78+ value : internal
79+
6380 - it : Test main container TPL Env
6481 values :
6582 - values.yaml
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.3
5+ version : 0.0.4
66type : library
77keywords :
88 - codefresh
Original file line number Diff line number Diff line change 22
33Codefresh library chart
44
5- ![ Version: 0.0.3 ] ( https://img.shields.io/badge/Version-0.0.3 -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.4 ] ( https://img.shields.io/badge/Version-0.0.4 -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.3
21+ version : 0.0.4
2222 repository : https://chartmuseum.codefresh.io/cf-common
2323` ` `
2424
Original file line number Diff line number Diff line change @@ -55,16 +55,15 @@ Usage:
5555 { {- end } }
5656
5757 { {- with .Values.env } }
58- env:
59- { {- include " cf-common.env-vars" (dict " Values" . " context" $) | trim | nindent 2 } }
60- { {- /* For backward compatibility */} }
58+ { {- /*
59+ For backward compatibility (.Values.env takes precedence over .Values.container.env)
60+ */} }
61+ { {- $mergedEnv := . } }
6162 { {- if $.Values.env } }
62- { {- include " cf-common.env-vars " (dict " Values " $.Values.env " context " $) | trim | nindent 2 } }
63+ { {- $ mergedEnv = mergeOverwrite . $.Values.env } }
6364 { {- end } }
64- { {- end } }
65-
66- { {- with .Values.extraEnvVars } }
67- { {- include " cf-common.tplrender" (dict " Values" . " context" $) | trim | nindent 2 } }
65+ env:
66+ { {- include " cf-common.env-vars" (dict " Values" $mergedEnv " context" $) | trim | nindent 2 } }
6867 { {- end } }
6968
7069 ports: { {- include " cf-common.ports" $ | trim | nindent 2 } }
You can’t perform that action at this time.
0 commit comments