@@ -60,6 +60,7 @@ const (
6060 hardwareDisk1 = "{{ index .Hardware.Disks 0 }}"
6161 hardwareName = "{{.hardware_name}}"
6262 ProvisionWorkerNodeTemplate = "provision-worker-node"
63+ PartitionNumber = "{{.partition_number}}"
6364)
6465
6566// TemplateClient handles interactions with the Tinkerbell Templates in the Tinkerbell cluster.
@@ -195,11 +196,11 @@ func createGrowPartitionAction(destDisk string) Action {
195196 Image : "quay.io/tinkerbell/actions/cexec:c5bde803d9f6c90f1a9d5e06930d856d1481854c" ,
196197 Timeout : 90 ,
197198 Environment : map [string ]string {
198- "BLOCK_DEVICE" : "{{ index .Hardware.Disks 0 }}3" ,
199+ "BLOCK_DEVICE" : fmt . Sprintf ( "{{ index .Hardware.Disks 0 }}%s" , PartitionNumber ) ,
199200 "FS_TYPE" : fsType ,
200201 "CHROOT" : "y" ,
201202 "DEFAULT_INTERPRETER" : defaultInterpreter ,
202- "CMD_LINE" : fmt .Sprintf ("growpart %s 3 && resize2fs %s3 " , destDisk , destDisk ),
203+ "CMD_LINE" : fmt .Sprintf ("growpart %s %s && resize2fs %s%s " , destDisk , PartitionNumber , destDisk , PartitionNumber ),
203204 },
204205 }
205206}
@@ -225,7 +226,7 @@ network:
225226 Image : "quay.io/tinkerbell-actions/writefile:v1.0.0" ,
226227 Timeout : 90 ,
227228 Environment : map [string ]string {
228- "DEST_DISK" : "{{ index .Hardware.Disks 0 }}3" ,
229+ "DEST_DISK" : fmt . Sprintf ( "{{ index .Hardware.Disks 0 }}%s" , PartitionNumber ) ,
229230 "FS_TYPE" : fsType ,
230231 "DEST_PATH" : "/etc/netplan/config.yaml" ,
231232 "CONTENTS" : netplaneConfig ,
@@ -250,7 +251,7 @@ echo 'local-hostname: {{.hardware_name}}' >> /var/lib/cloud/seed/nocloud/meta-da
250251 Image : "quay.io/tinkerbell-actions/cexec:v1.0.0" ,
251252 Timeout : 90 ,
252253 Environment : map [string ]string {
253- "BLOCK_DEVICE" : "{{ index .Hardware.Disks 0 }}3" ,
254+ "BLOCK_DEVICE" : fmt . Sprintf ( "{{ index .Hardware.Disks 0 }}%s" , PartitionNumber ) ,
254255 "FS_TYPE" : fsType ,
255256 "CHROOT" : "y" ,
256257 "DEFAULT_INTERPRETER" : defaultInterpreter ,
@@ -265,7 +266,7 @@ func decodeCloudInitFile(hardwareName string) Action {
265266 Image : "quay.io/tinkerbell/actions/cexec:latest" ,
266267 Timeout : 90 ,
267268 Environment : map [string ]string {
268- "BLOCK_DEVICE" : "{{ index .Hardware.Disks 0 }}3" ,
269+ "BLOCK_DEVICE" : fmt . Sprintf ( "{{ index .Hardware.Disks 0 }}%s" , PartitionNumber ) ,
269270 "FS_TYPE" : fsType ,
270271 "CHROOT" : "y" ,
271272 "DEFAULT_INTERPRETER" : "/bin/sh -c" ,
0 commit comments