fix: properly initialize manifest in user disks creation

This is 🤦, I somehow missed that installer Manifest is used
here and missed the fact I need to update it.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
This commit is contained in:
Andrey Smirnov 2020-10-29 21:07:57 +03:00 committed by Andrey Smirnov
parent 964e4405c3
commit aeb4883970

View File

@ -765,6 +765,7 @@ func MountUserDisks(seq runtime.Sequence, data interface{}) (runtime.TaskExecuti
// here.
func partitionAndFormatDisks(logger *log.Logger, r runtime.Runtime) (err error) {
m := &installer.Manifest{
Devices: map[string]installer.Device{},
Targets: map[string][]*installer.Target{},
}
@ -800,6 +801,11 @@ func partitionAndFormatDisks(logger *log.Logger, r runtime.Runtime) (err error)
}
}
m.Devices[disk.Device()] = installer.Device{
Device: disk.Device(),
ResetPartitionTable: true,
}
if m.Targets[disk.Device()] == nil {
m.Targets[disk.Device()] = []*installer.Target{}
}
@ -809,6 +815,8 @@ func partitionAndFormatDisks(logger *log.Logger, r runtime.Runtime) (err error)
Device: disk.Device(),
Size: part.Size(),
Force: true,
PartitionType: installer.LinuxFilesystemData,
FileSystemType: installer.FilesystemTypeXFS,
}
m.Targets[disk.Device()] = append(m.Targets[disk.Device()], extraTarget)