Skip to content

Commit bab661f

Browse files
committed
blueprint: sync latest changes from images
This commit syncs the latest changes from the blueprint changes in the images library. See osbuild/image-builder#1685
1 parent cb835bc commit bab661f

2 files changed

Lines changed: 27 additions & 0 deletions

File tree

pkg/blueprint/disk_customizations.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,14 @@ func (p *PartitionCustomization) ValidatePartitionLabel(ptType string) error {
607607
}
608608

609609
func (p *PartitionCustomization) validatePlain(mountpoints map[string]bool) error {
610+
if p.FSType == "none" {
611+
// make sure the mountpoint is empty and return
612+
if p.Mountpoint != "" {
613+
return fmt.Errorf("mountpoint for none partition must be empty (got %q)", p.Mountpoint)
614+
}
615+
return nil
616+
}
617+
610618
if p.FSType == "swap" {
611619
// make sure the mountpoint is empty and return
612620
if p.Mountpoint != "" {

pkg/blueprint/disk_customizations_test.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -865,6 +865,25 @@ func TestPartitioningValidation(t *testing.T) {
865865
},
866866
expectedMsg: "invalid partitioning customizations:\nunknown partition type: what",
867867
},
868+
"unhappy-none-with-mountpoint": {
869+
partitioning: &blueprint.DiskCustomization{
870+
Partitions: []blueprint.PartitionCustomization{
871+
{
872+
FilesystemTypedCustomization: blueprint.FilesystemTypedCustomization{
873+
FSType: "ext4",
874+
Mountpoint: "/home",
875+
},
876+
},
877+
{
878+
FilesystemTypedCustomization: blueprint.FilesystemTypedCustomization{
879+
FSType: "none",
880+
Mountpoint: "/none",
881+
},
882+
},
883+
},
884+
},
885+
expectedMsg: "invalid partitioning customizations:\nmountpoint for none partition must be empty (got \"/none\")",
886+
},
868887
"unhappy-swap-with-mountpoint": {
869888
partitioning: &blueprint.DiskCustomization{
870889
Partitions: []blueprint.PartitionCustomization{

0 commit comments

Comments
 (0)