Warn if config attempts to reuse partition by label #377
Labels
enhancement
New feature or request
good first issue
Good for newcomers
jira
validation
Issue related to config validation
Consider this config:
When the system is first provisioned with a blank
/dev/sdb
, Ignition will create a partitionfoo
starting 1 MiB into the disk and extending to the end of the disk. If the system is then reprovisioned, Ignition will create a second partitionfoo
in the first MiB of the disk:If the system is provisioned a third time, Ignition will fail.
This config appears to reuse the partition when reprovisioning, but actually doesn't, because Ignition matches existing partitions only by partition number and not by label (coreos/ignition#1219). We should fix that, but as a start, we can warn about it.
We should warn if a disk has
wipe_table: false
and any partitions havenumber: 0
. However, we need to special-case the root disk: since its partition table is rewritten on every reprovision, it's valid not to specify a partition number there, and we shouldn't warn. Unfortunately, the only way to distinguish the root disk is if it's specified via the/dev/disk/by-id/coreos-boot-disk
symlink, and legacy configs won't do that.Proposal: add a warning in the experimental spec only, and only for devices other than
coreos-boot-disk
. Phrase the message to make it clear that the warning can be avoided for the root disk by specifying it as/dev/disk/by-id/coreos-boot-disk
.The text was updated successfully, but these errors were encountered: