@@ -49,7 +49,6 @@ func TestNewNode(t *testing.T) {
4949 },
5050 },
5151 expectedBytes : []byte (`#cloud-config
52- write_files:
5352runcmd:
5453 - /etc/eks/bootstrap.sh test-cluster
5554` ),
@@ -67,7 +66,6 @@ runcmd:
6766 },
6867 },
6968 expectedBytes : []byte (`#cloud-config
70- write_files:
7169runcmd:
7270 - /etc/eks/bootstrap.sh test-cluster --kubelet-extra-args '--node-labels=node-role.undistro.io/infra=true --register-with-taints=dedicated=infra:NoSchedule'
7371` ),
@@ -81,7 +79,6 @@ runcmd:
8179 },
8280 },
8381 expectedBytes : []byte (`#cloud-config
84- write_files:
8582runcmd:
8683 - /etc/eks/bootstrap.sh test-cluster --container-runtime containerd
8784` ),
@@ -99,7 +96,6 @@ runcmd:
9996 },
10097 },
10198 expectedBytes : []byte (`#cloud-config
102- write_files:
10399runcmd:
104100 - /etc/eks/bootstrap.sh test-cluster --kubelet-extra-args '--node-labels=node-role.undistro.io/infra=true --register-with-taints=dedicated=infra:NoSchedule' --container-runtime containerd
105101` ),
@@ -114,7 +110,6 @@ runcmd:
114110 },
115111 },
116112 expectedBytes : []byte (`#cloud-config
117- write_files:
118113runcmd:
119114 - /etc/eks/bootstrap.sh test-cluster --ip-family ipv6 --service-ipv6-cidr fe80:0000:0000:0000:0204:61ff:fe9d:f156/24
120115` ),
@@ -128,7 +123,6 @@ runcmd:
128123 },
129124 },
130125 expectedBytes : []byte (`#cloud-config
131- write_files:
132126runcmd:
133127 - /etc/eks/bootstrap.sh test-cluster --use-max-pods false
134128` ),
@@ -142,7 +136,6 @@ runcmd:
142136 },
143137 },
144138 expectedBytes : []byte (`#cloud-config
145- write_files:
146139runcmd:
147140 - /etc/eks/bootstrap.sh test-cluster --aws-api-retry-attempts 5
148141` ),
@@ -157,7 +150,6 @@ runcmd:
157150 },
158151 },
159152 expectedBytes : []byte (`#cloud-config
160- write_files:
161153runcmd:
162154 - /etc/eks/bootstrap.sh test-cluster --pause-container-account 12345678 --pause-container-version v1
163155` ),
@@ -171,7 +163,6 @@ runcmd:
171163 },
172164 },
173165 expectedBytes : []byte (`#cloud-config
174- write_files:
175166runcmd:
176167 - /etc/eks/bootstrap.sh test-cluster --dns-cluster-ip 192.168.0.1
177168` ),
@@ -185,7 +176,6 @@ runcmd:
185176 },
186177 },
187178 expectedBytes : []byte (`#cloud-config
188- write_files:
189179runcmd:
190180 - /etc/eks/bootstrap.sh test-cluster --docker-config-json '{"debug":true}'
191181` ),
@@ -199,7 +189,6 @@ runcmd:
199189 },
200190 },
201191 expectedBytes : []byte (`#cloud-config
202- write_files:
203192runcmd:
204193 - "date"
205194 - "echo \"testing\""
@@ -215,7 +204,6 @@ runcmd:
215204 },
216205 },
217206 expectedBytes : []byte (`#cloud-config
218- write_files:
219207runcmd:
220208 - /etc/eks/bootstrap.sh test-cluster
221209 - "date"
@@ -232,7 +220,6 @@ runcmd:
232220 },
233221 },
234222 expectedBytes : []byte (`#cloud-config
235- write_files:
236223runcmd:
237224 - "echo \"testing pre\""
238225 - /etc/eks/bootstrap.sh test-cluster
@@ -248,7 +235,6 @@ runcmd:
248235 },
249236 },
250237 expectedBytes : []byte (`#cloud-config
251- write_files:
252238runcmd:
253239 - /custom/mybootstrap.sh test-cluster
254240` ),
@@ -280,7 +266,6 @@ runcmd:
280266 },
281267 },
282268 expectedBytes : []byte (`#cloud-config
283- write_files:
284269runcmd:
285270 - /etc/eks/bootstrap.sh test-cluster
286271disk_setup:
@@ -323,6 +308,31 @@ write_files:
323308 fs.inotify.max_user_instances=256
324309runcmd:
325310 - /etc/eks/bootstrap.sh test-cluster
311+ ` ),
312+ },
313+ {
314+ name : "with empty files" ,
315+ args : args {
316+ input : & NodeInput {
317+ ClusterName : "test-cluster" ,
318+ Files : []eksbootstrapv1.File {},
319+ },
320+ },
321+ expectedBytes : []byte (`#cloud-config
322+ runcmd:
323+ - /etc/eks/bootstrap.sh test-cluster
324+ ` ),
325+ },
326+ {
327+ name : "with nil files" ,
328+ args : args {
329+ input : & NodeInput {
330+ ClusterName : "test-cluster" ,
331+ },
332+ },
333+ expectedBytes : []byte (`#cloud-config
334+ runcmd:
335+ - /etc/eks/bootstrap.sh test-cluster
326336` ),
327337 },
328338 {
@@ -337,7 +347,6 @@ runcmd:
337347 },
338348 },
339349 expectedBytes : []byte (`#cloud-config
340- write_files:
341350runcmd:
342351 - /etc/eks/bootstrap.sh test-cluster
343352ntp:
363372 },
364373 },
365374 expectedBytes : []byte (`#cloud-config
366- write_files:
367375runcmd:
368376 - /etc/eks/bootstrap.sh test-cluster
369377users:
0 commit comments