@@ -1404,7 +1404,7 @@ var _ = Describe("cloudInitToButane", func() {
14041404
14051405 It ("should convert bootcmds to a systemd unit and shell script" , func () {
14061406 var config = cloudInit {BootCommands : []string {"echo hello world" , "ls 'some dir'" }}
1407- var butane = cloudInitToButane (config )
1407+ var butane = cloudInitToButane (config , kubernetesFlatcarNodeCustomDataYaml )
14081408 checkForUnit (butane )
14091409 Expect (butane .Storage .Files ).To (HaveLen (1 ))
14101410 var file = butane .Storage .Files [0 ]
@@ -1447,7 +1447,7 @@ var _ = Describe("cloudInitToButane", func() {
14471447 Content : string (gzipped ),
14481448 },
14491449 }}
1450- var butane = cloudInitToButane (config )
1450+ var butane = cloudInitToButane (config , kubernetesFlatcarNodeCustomDataYaml )
14511451 Expect (butane .Storage .Files ).To (HaveLen (1 ))
14521452 var file = butane .Storage .Files [0 ]
14531453 tarball , err := decodeButaneResource (file .Contents )
@@ -1476,7 +1476,7 @@ var _ = Describe("cloudInitToButane", func() {
14761476 Content : encoded ,
14771477 },
14781478 }}
1479- var butane = cloudInitToButane (config )
1479+ var butane = cloudInitToButane (config , kubernetesFlatcarNodeCustomDataYaml )
14801480 Expect (butane .Storage .Files ).To (HaveLen (1 ))
14811481 var file = butane .Storage .Files [0 ]
14821482 tarball , err := decodeButaneResource (file .Contents )
@@ -1496,7 +1496,7 @@ var _ = Describe("cloudInitToButane", func() {
14961496
14971497 It ("should create a system unit but not a shell script with no bootcmds" , func () {
14981498 var config = cloudInit {BootCommands : []string {}}
1499- var butane = cloudInitToButane (config )
1499+ var butane = cloudInitToButane (config , kubernetesFlatcarNodeCustomDataYaml )
15001500 checkForUnit (butane )
15011501 Expect (butane .Storage .Files ).To (BeEmpty ())
15021502 Expect (butane .Systemd .Units ).NotTo (BeEmpty ())
@@ -1511,6 +1511,24 @@ var _ = Describe("cloudInitToButane", func() {
15111511 }
15121512 Expect (found ).To (BeTrue ())
15131513 })
1514+
1515+ It ("should include storage links for ACL butane config" , func () {
1516+ var config = cloudInit {BootCommands : []string {"echo hello" }}
1517+ var butane = cloudInitToButane (config , kubernetesACLNodeCustomDataYaml )
1518+ checkForUnit (butane )
1519+ Expect (butane .Storage .Links ).To (HaveLen (2 ))
1520+ Expect (butane .Storage .Links [0 ].Path ).To (Equal ("/etc/systemd/system/sysinit.target.wants/ignition-bootcmds.service" ))
1521+ Expect (* butane .Storage .Links [0 ].Target ).To (Equal ("/etc/systemd/system/ignition-bootcmds.service" ))
1522+ Expect (butane .Storage .Links [1 ].Path ).To (Equal ("/etc/systemd/system/sysinit.target.wants/ignition-file-extract.service" ))
1523+ Expect (* butane .Storage .Links [1 ].Target ).To (Equal ("/etc/systemd/system/ignition-file-extract.service" ))
1524+ })
1525+
1526+ It ("should not include storage links for Flatcar butane config" , func () {
1527+ var config = cloudInit {BootCommands : []string {"echo hello" }}
1528+ var butane = cloudInitToButane (config , kubernetesFlatcarNodeCustomDataYaml )
1529+ checkForUnit (butane )
1530+ Expect (butane .Storage .Links ).To (BeEmpty ())
1531+ })
15141532})
15151533
15161534func decodeButaneResource (resource base0_5.Resource ) ([]byte , error ) {
0 commit comments