File tree Expand file tree Collapse file tree 17 files changed +146
-72
lines changed Expand file tree Collapse file tree 17 files changed +146
-72
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ Codefresh library chart - test chart - not for deployment!
3737| podSecurityContext | object | ` {} ` | |
3838| rbac.serviceAccount | object | ` {} ` | |
3939| secrets | object | ` {} ` | |
40- | services | object | ` {} ` | |
40+ | service | object | ` {} ` | |
4141| tolerations | list | ` [] ` | |
4242| volumes | object | ` {} ` | |
4343
Original file line number Diff line number Diff line change 1- {{- include "cf-common.services " . -}}
1+ {{- include "cf-common.service " . -}}
Original file line number Diff line number Diff line change @@ -60,6 +60,65 @@ tests:
6060 path : spec.template.spec.containers[0].env[0].value
6161 value : BOB
6262
63+ - it : Test main container with .Values.global.env
64+ values :
65+ - values.yaml
66+ set :
67+ global :
68+ env :
69+ GLOBAL_VAR : somevalue
70+ asserts :
71+ - lengthEqual :
72+ path : spec.template.spec.containers[0].env
73+ count : 2
74+ - contains :
75+ path : spec.template.spec.containers[0].env
76+ content :
77+ name : GLOBAL_VAR
78+ value : somevalue
79+
80+ - it : Test main container with .Values.global.env with override
81+ values :
82+ - values.yaml
83+ set :
84+ global :
85+ env :
86+ ALICE : globalvalue
87+ container :
88+ env :
89+ ALICE : localvalue
90+ asserts :
91+ - lengthEqual :
92+ path : spec.template.spec.containers[0].env
93+ count : 1
94+ - contains :
95+ path : spec.template.spec.containers[0].env
96+ content :
97+ name : ALICE
98+ value : localvalue
99+
100+ - it : Test main container with .Values.global.env with override and legacy .Values.env
101+ values :
102+ - values.yaml
103+ set :
104+ global :
105+ env :
106+ ALICE : globalvalue
107+ container :
108+ env :
109+ ALICE : localvalue
110+ env :
111+ ALICE : legacyenv
112+ asserts :
113+ - lengthEqual :
114+ path : spec.template.spec.containers[0].env
115+ count : 1
116+ - contains :
117+ path : spec.template.spec.containers[0].env
118+ content :
119+ name : ALICE
120+ value : legacyenv
121+
63122 # For backward compatibility
64123 - it : Test .Values.env precedence over .Values.container.env
65124 values :
Original file line number Diff line number Diff line change 33 imagePullSecrets :
44 - global-pull-secret
55 volumeName : some-existing-volume
6-
76imagePullSecrets :
87 - my-pull-secret
98
Original file line number Diff line number Diff line change 77 values :
88 - values.yaml
99 set :
10- services :
10+ service :
1111 main :
1212 ports :
1313 http :
1414 protocol : ICMP
1515 asserts :
1616 - failedTemplate :
17- errorMessage : " services .main.ports.http.protocol is invalid!"
17+ errorMessage : " service .main.ports.http.protocol is invalid!"
1818
1919 - it : Test metrics service with no port specified
2020 values :
2121 - values.yaml
2222 set :
23- services :
23+ service :
2424 metrics :
2525 enabled : true
2626 ports :
@@ -29,23 +29,23 @@ tests:
2929 protocol : HTTP
3030 asserts :
3131 - failedTemplate :
32- errorMessage : " services .metrics.ports.metrics.port number is required!"
32+ errorMessage : " service .metrics.ports.metrics.port number is required!"
3333
3434 - it : Test invalid service type
3535 values :
3636 - values.yaml
3737 set :
38- services :
38+ service :
3939 main :
4040 type : Something
4141 asserts :
4242 - failedTemplate :
43- errorMessage : " services .main.type is invalid service type!"
43+ errorMessage : " service .main.type is invalid service type!"
4444
4545 - it : Test disabled service
4646 template : templates/service.yaml
4747 set :
48- services :
48+ service :
4949 main :
5050 enabled : false
5151 asserts :
5555 - it : Test services items as list (not map)
5656 template : templates/service.yaml
5757 set :
58- services :
58+ service :
5959 - main :
6060 primary : true
6161 type : ClusterIP
6565 protocol : HTTP
6666 asserts :
6767 - failedTemplate :
68- errorMessage : " services block must be a map!"
68+ errorMessage : " service block must be a map!"
Original file line number Diff line number Diff line change 2828 values :
2929 - values.yaml
3030 set :
31- services :
31+ service :
3232 main :
3333 labels :
3434 alice : bob
5656 values :
5757 - values.yaml
5858 set :
59- services :
59+ service :
6060 metrics :
6161 enabled : true
6262 type : ClusterIP
Original file line number Diff line number Diff line change 5050 values :
5151 - values.yaml
5252 set :
53- services :
53+ service :
5454 main :
5555 extraSelectorLabels :
5656 extra : label
6969 values :
7070 - values.yaml
7171 set :
72- services :
72+ service :
7373 main :
7474 ports :
7575 http :
9292 values :
9393 - values.yaml
9494 set :
95- services :
95+ service :
9696 metrics :
9797 enabled : true
9898 type : ClusterIP
@@ -116,7 +116,7 @@ tests:
116116 - values.yaml
117117 documentIndex : 1
118118 set :
119- services :
119+ service :
120120 metrics :
121121 enabled : true
122122 ports :
@@ -133,7 +133,7 @@ tests:
133133 values :
134134 - values.yaml
135135 set :
136- services :
136+ service :
137137 metrics :
138138 enabled : true
139139 type : ClusterIP
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ container:
1414 tag : master
1515 pullPolicy : Always
1616
17- services :
17+ service :
1818 main :
1919 enabled : true
2020 primary : true
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ configMaps: {}
1111
1212secrets : {}
1313
14- services : {}
14+ service : {}
1515
1616ingress : {}
1717
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.8
5+ version : 0.0.9
66type : library
77keywords :
88 - codefresh
You can’t perform that action at this time.
0 commit comments