mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-19 09:16:29 +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:
parent
66ca00915a
commit
7ac34a6aec
@ -82,6 +82,11 @@ func extend(d, fsType string) error {
|
|||||||
return fmt.Errorf("Unable to unmarshal partition table from sfdisk: %v", err)
|
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 {
|
if len(f.PartitionTable.Partitions) > 1 {
|
||||||
log.Printf("Disk %s has more than 1 partition. Skipping", d)
|
log.Printf("Disk %s has more than 1 partition. Skipping", d)
|
||||||
return nil
|
return nil
|
||||||
|
@ -6,7 +6,7 @@ init:
|
|||||||
- linuxkit/runc:8b5af3365fc7d015db4e44113d93c7b1f8e2d2ab
|
- linuxkit/runc:8b5af3365fc7d015db4e44113d93c7b1f8e2d2ab
|
||||||
onboot:
|
onboot:
|
||||||
- name: extend
|
- name: extend
|
||||||
image: linuxkit/extend:9fa90cc4ba8c261b8eb5adacda71feb2f60d75e3
|
image: linuxkit/extend:4fe799316df0f29a6930a5363841057d7c55484b
|
||||||
- name: mount
|
- name: mount
|
||||||
image: linuxkit/mount:2a507ef30302693682f9f612289028df00c58ac5
|
image: linuxkit/mount:2a507ef30302693682f9f612289028df00c58ac5
|
||||||
command: ["/usr/bin/mountie", "/var/lib/docker"]
|
command: ["/usr/bin/mountie", "/var/lib/docker"]
|
||||||
|
@ -9,7 +9,7 @@ onboot:
|
|||||||
image: linuxkit/modprobe:fad39ef443853ef02520052cdbf6acbeb4ec7799
|
image: linuxkit/modprobe:fad39ef443853ef02520052cdbf6acbeb4ec7799
|
||||||
command: ["modprobe", "btrfs"]
|
command: ["modprobe", "btrfs"]
|
||||||
- name: extend
|
- name: extend
|
||||||
image: linuxkit/extend:9fa90cc4ba8c261b8eb5adacda71feb2f60d75e3
|
image: linuxkit/extend:4fe799316df0f29a6930a5363841057d7c55484b
|
||||||
command: ["/usr/bin/extend", "-type", "btrfs"]
|
command: ["/usr/bin/extend", "-type", "btrfs"]
|
||||||
- name: mount
|
- name: mount
|
||||||
image: linuxkit/mount:2a507ef30302693682f9f612289028df00c58ac5
|
image: linuxkit/mount:2a507ef30302693682f9f612289028df00c58ac5
|
||||||
|
@ -6,7 +6,7 @@ init:
|
|||||||
- linuxkit/runc:8b5af3365fc7d015db4e44113d93c7b1f8e2d2ab
|
- linuxkit/runc:8b5af3365fc7d015db4e44113d93c7b1f8e2d2ab
|
||||||
onboot:
|
onboot:
|
||||||
- name: extend
|
- name: extend
|
||||||
image: linuxkit/extend:9fa90cc4ba8c261b8eb5adacda71feb2f60d75e3
|
image: linuxkit/extend:4fe799316df0f29a6930a5363841057d7c55484b
|
||||||
command: ["/usr/bin/extend", "-type", "xfs"]
|
command: ["/usr/bin/extend", "-type", "xfs"]
|
||||||
- name: mount
|
- name: mount
|
||||||
image: linuxkit/mount:2a507ef30302693682f9f612289028df00c58ac5
|
image: linuxkit/mount:2a507ef30302693682f9f612289028df00c58ac5
|
||||||
|
@ -6,7 +6,7 @@ init:
|
|||||||
- linuxkit/runc:8b5af3365fc7d015db4e44113d93c7b1f8e2d2ab
|
- linuxkit/runc:8b5af3365fc7d015db4e44113d93c7b1f8e2d2ab
|
||||||
onboot:
|
onboot:
|
||||||
- name: extend
|
- name: extend
|
||||||
image: linuxkit/extend:9fa90cc4ba8c261b8eb5adacda71feb2f60d75e3
|
image: linuxkit/extend:4fe799316df0f29a6930a5363841057d7c55484b
|
||||||
- name: mount
|
- name: mount
|
||||||
image: linuxkit/mount:2a507ef30302693682f9f612289028df00c58ac5
|
image: linuxkit/mount:2a507ef30302693682f9f612289028df00c58ac5
|
||||||
command: ["/usr/bin/mountie", "/var/lib/docker"]
|
command: ["/usr/bin/mountie", "/var/lib/docker"]
|
||||||
|
Loading…
Reference in New Issue
Block a user