Merge pull request #2086 from mslacken/addPartwipe

Added --partwipe flag for set
This commit is contained in:
Christian Goll
2026-01-21 10:39:00 +01:00
committed by GitHub
5 changed files with 63 additions and 5 deletions

View File

@@ -11,6 +11,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Remove requisite dependency between ignition disk target and ignition service. #2083 - Remove requisite dependency between ignition disk target and ignition service. #2083
- Return HTTP 409 status when creating an existing overlay - Return HTTP 409 status when creating an existing overlay
### Added
- New --partwipe flag for profile and node set
## v4.6.5, 2026-01-12 ## v4.6.5, 2026-01-12
### Added ### Added

View File

@@ -659,6 +659,28 @@ nodeprofiles: {}
nodes: nodes:
n1: {}`, 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 { for name, tt := range tests {

View File

@@ -227,6 +227,38 @@ nodeprofiles:
/dev/disk/by-partlabel/var: /dev/disk/by-partlabel/var:
format: btrfs format: btrfs
path: /var 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: {}`, nodes: {}`,
}, },
} }

View File

@@ -110,7 +110,7 @@ type Partition struct {
StartMiB string `yaml:"start_mib,omitempty" json:"start_mib,omitempty" comment:"the start of the partition" type:"uint"` StartMiB string `yaml:"start_mib,omitempty" json:"start_mib,omitempty" comment:"the start of the partition" type:"uint"`
TypeGuid string `yaml:"type_guid,omitempty" json:"type_guid,omitempty" lopt:"parttype" comment:"Set the partition type GUID"` TypeGuid string `yaml:"type_guid,omitempty" json:"type_guid,omitempty" lopt:"parttype" comment:"Set the partition type GUID"`
Guid string `yaml:"guid,omitempty" json:"guid,omitempty" comment:"the GPT unique partition GUID"` Guid string `yaml:"guid,omitempty" json:"guid,omitempty" comment:"the GPT unique partition GUID"`
WipePartitionEntryP *bool `yaml:"wipe_partition_entry,omitempty" json:"wipe_partition_entry,omitempty" comment:"if true, Ignition will clobber an existing partition if it does not match the config" name:"WipePartitionEntry"` WipePartitionEntryP *bool `yaml:"wipe_partition_entry,omitempty" json:"wipe_partition_entry,omitempty" lopt:"partwipe" comment:"if true, Ignition will clobber an existing partition if it does not match the config" name:"WipePartitionEntry"`
ShouldExistP *bool `yaml:"should_exist,omitempty" json:"should_exist,omitempty" lopt:"partcreate" comment:"Create partition if it does not exist" name:"ShouldExist"` ShouldExistP *bool `yaml:"should_exist,omitempty" json:"should_exist,omitempty" lopt:"partcreate" comment:"Create partition if it does not exist" name:"ShouldExist"`
ResizeP *bool `yaml:"resize,omitempty" json:"resize,omitempty" comment:"whether or not the existing partition should be resize" name:"Resize"` ResizeP *bool `yaml:"resize,omitempty" json:"resize,omitempty" comment:"whether or not the existing partition should be resize" name:"Resize"`
} }

View File

@@ -54,15 +54,15 @@ but specifying it is recommended as Ignition may fail without it. Partition
sizes should also be set (specified in MiB), except for the last partition: if sizes should also be set (specified in MiB), except for the last partition: if
no size is given, the maximum available size is used. Each partition has the no size is given, the maximum available size is used. Each partition has the
switches ``should_exist`` and ``wipe_partition_entry`` which control the switches ``should_exist`` and ``wipe_partition_entry`` which control the
partition creation process. When omitting a partition number the partition creation process (via the ``--partcreate`` and ``--partwipe`` flags).
`wipe_partition_entry` should be true, as this allows ignition to replace the When omitting a partition number the `wipe_partition_entry` should be true, as
existing partition. this allows ignition to replace the existing partition.
.. code-block:: shell .. code-block:: shell
wwctl node set n1 \ wwctl node set n1 \
--diskname /dev/vda --diskwipe \ --diskname /dev/vda --diskwipe \
--partname scratch --partcreate --partnumber 1 --partname scratch --partcreate --partwipe --partnumber 1
File systems File systems
============ ============