Added --partwipe flag for set

This commit is contained in:
Christian Goll
2026-01-14 10:37:05 +01:00
parent b30a2cfb65
commit a0efd7fe08
5 changed files with 63 additions and 5 deletions

View File

@@ -659,6 +659,28 @@ nodeprofiles: {}
nodes:
n1: {}`,
},
"--partwipe": {
args: []string{"--partwipe", "--partname=var", "--diskname=/dev/vda", "n01"},
wantErr: false,
inDB: `
nodes:
n01:
disks:
/dev/vda:
partitions:
var:
number: "1"`,
outDB: `
nodeprofiles: {}
nodes:
n01:
disks:
/dev/vda:
partitions:
var:
number: "1"
wipe_partition_entry: true`,
},
}
for name, tt := range tests {

View File

@@ -227,6 +227,38 @@ nodeprofiles:
/dev/disk/by-partlabel/var:
format: btrfs
path: /var
nodes: {}`,
},
"single set partwipe to true": {
args: []string{"--partwipe=true", "--partname=var", "--diskname=/dev/vda", "default"},
wantErr: false,
inDB: `
nodeprofiles:
default:
disks:
/dev/vda:
partitions:
var:
number: "1"
filesystems:
/dev/disk/by-partlabel/var:
format: btrfs
path: /var
nodes: {}
`,
outDb: `
nodeprofiles:
default:
disks:
/dev/vda:
partitions:
var:
number: "1"
wipe_partition_entry: true
filesystems:
/dev/disk/by-partlabel/var:
format: btrfs
path: /var
nodes: {}`,
},
}