pkg/disk.yaml: add an option to not grow root#2524
Conversation
f903eda to
f486058
Compare
achilleas-k
left a comment
There was a problem hiding this comment.
A few minor comments below but more generally:
I'm not sure where this option fits better. I'll have to think about it some more but I think my preference right now is to make not growing the default behaviour for image definitions. We would have to keep the blueprint behaviour the same, so users don't get different behaviour, but the image definitions make no stability guarantees. So the new rules would be:
- Partition tables in image definitions get created as they are described, with no growing.
- Customizing a partition table from the blueprint does automatic things, including root growing.
- Blueprint adds an option, somewhere, that prevents growing root to fill.
- This could be a boolean, but it might also become an option that lets users control which filesystem to grow. In other words, it could be
grow_to_fill = "<mountpoint>|None", with default value/, andNonedisabling the behaviour.
- This could be a boolean, but it might also become an option that lets users control which filesystem to grow. In other words, it could be
- Grow to fill option is also added to image definitions for similar behaviour.
This is just a bit of brainstorming, so don't take any of these as instructions. We need to consider all side effects and how this fits into potential future behaviour first.
| // Controls whether the root partition (the one containing "/") is | ||
| // grown to fill the remaining disk space during relayout. Defaults | ||
| // to true (nil means true) to preserve backward compatibility. Set | ||
| // to false to keep the root partition at its specified size. | ||
| GrowRootToFillDisk *bool `json:"grow_root_to_fill_disk,omitempty" yaml:"grow_root_to_fill_disk,omitempty"` |
There was a problem hiding this comment.
I don't really like booleans defaulting to true. We do have it in a few places, but that's usually when interacting with external configs and their defaults. If we're making our own, I'd rather avoid it.
Negative bools (like DisableX = true) are also a bit tricky and error prone. But this whole discussion is moot anyway.
There was a problem hiding this comment.
I made it default to true so it keep the same existing behavior when not specified, to not change people that haven't changed their configs.
Add a `grow_root_to_fill_disk` boolean option to allow not growing the root partition to use all available space. Defaults to `true` for backwards compatibility. This allows creating disk images with empty available space, so users can create additionnal partitions or grow the root at first boot via e.g. `cloud-utils-growpart`. See discussion in coreos/fedora-coreos-tracker#2188 Assisted-By: Opencode.ai <Opus 4.6>
f486058 to
c3343a0
Compare
Add a
grow_root_to_fill_diskboolean option to allow not growing the root partition to use all available space. Defaults totruefor backwards compatibility.This allows creating disk images with empty available space, so users can create additionnal partitions or grow the root at first boot via e.g.
cloud-utils-growpart.See discussion in coreos/fedora-coreos-tracker#2188
Assisted-By: Opencode.ai <Opus 4.6>