11suite : nodeExporter
22templates :
3- - NOTES.txt
3+ - other-resources/ NOTES.txt
44 - node-exporter/node-exporter.ClusterRole.yaml
55 - node-exporter/node-exporter.ClusterRoleBinding.yaml
66 - node-exporter/node-exporter.DaemonSet.yaml
@@ -9,7 +9,7 @@ templates:
99 - node-exporter/node-exporter.ServiceAccount.yaml
1010tests :
1111 - it : should render the DaemonSet and Service if node-exporter is enabled
12- set :
12+ set :
1313 nodeExporter :
1414 enabled : true
1515 asserts :
@@ -25,11 +25,11 @@ tests:
2525 template : node-exporter/node-exporter.Service.yaml
2626
2727 - it : should not render any resources if node-exporter is disabled
28- set :
28+ set :
2929 nodeExporter :
3030 enabled : false
3131 asserts :
32- - hasDocuments :
32+ - hasDocuments :
3333 count : 0
3434 templates :
3535 - node-exporter/node-exporter.ClusterRole.yaml
@@ -41,25 +41,25 @@ tests:
4141
4242 - it : should not render the PodSecurityPolicy, Service Accounts, and ClusterRoles by default
4343 asserts :
44- - hasDocuments :
44+ - hasDocuments :
4545 count : 0
4646 template : node-exporter/node-exporter.PodSecurityPolicy.yaml
47- - hasDocuments :
47+ - hasDocuments :
4848 count : 0
4949 template : node-exporter/node-exporter.ClusterRole.yaml
50- - hasDocuments :
50+ - hasDocuments :
5151 count : 0
5252 template : node-exporter/node-exporter.ClusterRoleBinding.yaml
53- - hasDocuments :
53+ - hasDocuments :
5454 count : 0
5555 template : node-exporter/node-exporter.ServiceAccount.yaml
5656
5757 - it : should render the PodSecurityPolicy, ServiceAccounts, and ClusterRoles if PodSecurityPolicy + Service Accounts are enabled
58- set :
58+ set :
5959 nodeExporter :
6060 serviceAccount :
6161 create : true
62- podSecurityPolicy :
62+ podSecurityPolicy :
6363 enabled : true
6464 asserts :
6565 - containsDocument :
8282 apiVersion : rbac.authorization.k8s.io/v1
8383 name : node-exporter
8484 template : node-exporter/node-exporter.ClusterRoleBinding.yaml
85-
85+
8686 - it : should add the ServiceAccount name to the DaemonSet spec if the ServiceAccount is enabled
87- set :
87+ set :
8888 nodeExporter :
8989 serviceAccount :
9090 create : true
9494 path : spec.template.spec.serviceAccountName
9595 value : " test-service-account-name"
9696 template : node-exporter/node-exporter.DaemonSet.yaml
97-
97+
9898 - it : should add not the ServiceAccount name to the DaemonSet spec if the ServiceAccount is disabled
99- set :
99+ set :
100100 nodeExporter :
101101 serviceAccount :
102102 create : false
@@ -105,30 +105,30 @@ tests:
105105 - notExists :
106106 path : spec.template.spec.serviceAccountName
107107 template : node-exporter/node-exporter.DaemonSet.yaml
108-
108+
109109 - it : should fail to render if the PodSecurityPolicy is enabled, but the ServiceAccount isn't
110- set :
110+ set :
111111 nodeExporter :
112112 serviceAccount :
113113 create : false
114- podSecurityPolicy :
114+ podSecurityPolicy :
115115 enabled : true
116116 asserts :
117117 - failedTemplate :
118118 errorMessage : " Node Exporter's service account must be enabled in order to use its pod security policy (set 'nodeExporter.ServiceAccount.create' to true)"
119119 template : node-exporter/node-exporter.PodSecurityPolicy.yaml
120120
121- - it : should not render the podSecurityPolicy if disabled
122- set :
121+ - it : should not render the podSecurityPolicy if disabled
122+ set :
123123 nodeExporter :
124- podSecurityPolicy :
124+ podSecurityPolicy :
125125 enabled : false
126126 asserts :
127127 - hasDocuments :
128128 count : 0
129129 template : node-exporter/node-exporter.PodSecurityPolicy.yaml
130-
131- - it : should ensure that the namespace is properly propagated to the cluster role binding
130+
131+ - it : should ensure that the namespace is properly propagated to the cluster role binding
132132 release :
133133 namespace : " my-test-namespace"
134134 set :
@@ -151,16 +151,16 @@ tests:
151151 create : true
152152 podSecurityPolicy :
153153 enabled : true
154- asserts :
155- - equal :
154+ asserts :
155+ - equal :
156156 path : spec.template.spec.hostPID
157157 value : true
158158 template : node-exporter/node-exporter.DaemonSet.yaml
159- - equal :
159+ - equal :
160160 path : spec.hostPID
161161 value : true
162162 template : node-exporter/node-exporter.PodSecurityPolicy.yaml
163-
163+
164164 - it : should propagate host PID settings to both the daemonset and podSecurityPolicy
165165 set :
166166 nodeExporter :
@@ -170,12 +170,12 @@ tests:
170170 create : true
171171 podSecurityPolicy :
172172 enabled : true
173- asserts :
174- - equal :
173+ asserts :
174+ - equal :
175175 path : spec.template.spec.hostPID
176176 value : false
177177 template : node-exporter/node-exporter.DaemonSet.yaml
178- - equal :
178+ - equal :
179179 path : spec.hostPID
180180 value : false
181181 template : node-exporter/node-exporter.PodSecurityPolicy.yaml
@@ -184,34 +184,34 @@ tests:
184184 set :
185185 nodeExporter :
186186 enabled : true
187- asserts :
187+ asserts :
188188 - notMatchRegexRaw :
189189 pattern : You have set 'nodeExporter.enabled' to 'false'
190- template : NOTES.txt
191-
190+ template : other-resources/ NOTES.txt
191+
192192 - it : should generate warnings if node-exporter is disabled
193193 set :
194194 nodeExporter :
195195 enabled : false
196- asserts :
196+ asserts :
197197 - matchRegexRaw :
198198 pattern : You have set 'nodeExporter.enabled' to 'false'
199- template : NOTES.txt
199+ template : other-resources/ NOTES.txt
200200
201201 - it : should not generate warnings if hostPID is true
202202 set :
203203 nodeExporter :
204204 hostPID : true
205- asserts :
205+ asserts :
206206 - notMatchRegexRaw :
207207 pattern : You have set 'nodeExporter.hostPID' to 'false'
208- template : NOTES.txt
208+ template : other-resources/ NOTES.txt
209209
210- - it : should generate warnings if hostPID is false
210+ - it : should generate warnings if hostPID is false
211211 set :
212212 nodeExporter :
213213 hostPID : false
214- asserts :
214+ asserts :
215215 - matchRegexRaw :
216216 pattern : You have set 'nodeExporter.hostPID' to 'false'
217- template : NOTES.txt
217+ template : other-resources/ NOTES.txt
0 commit comments