mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-09-09 19:00:54 +00:00
pkg/extend fix panic for empty partition tables (#4101)
Signed-off-by: Chris Irrgang <chris.irrgang@gmx.de>
This commit is contained in:
@@ -82,6 +82,11 @@ func extend(d, fsType string) error {
|
||||
return fmt.Errorf("Unable to unmarshal partition table from sfdisk: %v", err)
|
||||
}
|
||||
|
||||
if len(f.PartitionTable.Partitions) == 0 {
|
||||
log.Printf("Disk %s has no partitions. Skipping", d)
|
||||
return nil
|
||||
}
|
||||
|
||||
if len(f.PartitionTable.Partitions) > 1 {
|
||||
log.Printf("Disk %s has more than 1 partition. Skipping", d)
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user