@@ -197,17 +197,17 @@ func createGrowPartitionAction(destDisk string) Action {
197
197
Image : "quay.io/tinkerbell/actions/cexec:c5bde803d9f6c90f1a9d5e06930d856d1481854c" ,
198
198
Timeout : 90 ,
199
199
Environment : map [string ]string {
200
- "BLOCK_DEVICE" : fmt .Sprintf ("{{ index .Hardware.Disks 0 }}%s" , PartitionNumber ),
200
+ "BLOCK_DEVICE" : fmt .Sprintf ("{{ formatPartition ( index .Hardware.Disks 0 ) (.partition_number | int) }}" ),
201
201
"FS_TYPE" : fsType ,
202
202
"CHROOT" : "y" ,
203
203
"DEFAULT_INTERPRETER" : defaultInterpreter ,
204
- "CMD_LINE" : fmt .Sprintf ("growpart %s %s && resize2fs %s%s" , destDisk , PartitionNumber , destDisk , PartitionNumber ),
204
+ "CMD_LINE" : fmt .Sprintf ("growpart %s %s && resize2fs '{{ formatPartition ( index .Hardware.Disks 0 ) (.partition_number | int) }}'" , destDisk , PartitionNumber ),
205
205
},
206
206
}
207
207
}
208
208
209
209
func createNetworkConfigAction () Action {
210
- netplaneConfig := `
210
+ netplanConfig := `
211
211
network:
212
212
version: 2
213
213
renderer: networkd
@@ -227,10 +227,10 @@ network:
227
227
Image : "quay.io/tinkerbell-actions/writefile:v1.0.0" ,
228
228
Timeout : 90 ,
229
229
Environment : map [string ]string {
230
- "DEST_DISK" : fmt .Sprintf ("{{ index .Hardware.Disks 0 }}%s" , PartitionNumber ),
230
+ "DEST_DISK" : fmt .Sprintf ("{{ formatPartition ( index .Hardware.Disks 0 ) (.partition_number | int) }}" ),
231
231
"FS_TYPE" : fsType ,
232
232
"DEST_PATH" : "/etc/netplan/config.yaml" ,
233
- "CONTENTS" : netplaneConfig ,
233
+ "CONTENTS" : netplanConfig ,
234
234
"UID" : "0" ,
235
235
"GID" : "0" ,
236
236
"MODE" : "0644" ,
@@ -252,7 +252,7 @@ echo 'local-hostname: {{.hardware_name}}' >> /var/lib/cloud/seed/nocloud/meta-da
252
252
Image : "quay.io/tinkerbell-actions/cexec:v1.0.0" ,
253
253
Timeout : 90 ,
254
254
Environment : map [string ]string {
255
- "BLOCK_DEVICE" : fmt .Sprintf ("{{ index .Hardware.Disks 0 }}%s" , PartitionNumber ),
255
+ "BLOCK_DEVICE" : fmt .Sprintf ("{{ formatPartition ( index .Hardware.Disks 0 ) (.partition_number | int) }}" ),
256
256
"FS_TYPE" : fsType ,
257
257
"CHROOT" : "y" ,
258
258
"DEFAULT_INTERPRETER" : defaultInterpreter ,
@@ -267,7 +267,7 @@ func decodeCloudInitFile(hardwareName string) Action {
267
267
Image : "quay.io/tinkerbell/actions/cexec:latest" ,
268
268
Timeout : 90 ,
269
269
Environment : map [string ]string {
270
- "BLOCK_DEVICE" : fmt .Sprintf ("{{ index .Hardware.Disks 0 }}%s" , PartitionNumber ),
270
+ "BLOCK_DEVICE" : fmt .Sprintf ("{{ formatPartition ( index .Hardware.Disks 0 ) (.partition_number | int) }}" ),
271
271
"FS_TYPE" : fsType ,
272
272
"CHROOT" : "y" ,
273
273
"DEFAULT_INTERPRETER" : "/bin/sh -c" ,
0 commit comments