File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -607,6 +607,14 @@ func (p *PartitionCustomization) ValidatePartitionLabel(ptType string) error {
607607}
608608
609609func (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 != "" {
Original file line number Diff line number Diff line change @@ -865,6 +865,25 @@ func TestPartitioningValidation(t *testing.T) {
865865 },
866866 expectedMsg : "invalid partitioning customizations:\n unknown 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:\n mountpoint for none partition must be empty (got \" /none\" )" ,
886+ },
868887 "unhappy-swap-with-mountpoint" : {
869888 partitioning : & blueprint.DiskCustomization {
870889 Partitions : []blueprint.PartitionCustomization {
You can’t perform that action at this time.
0 commit comments