fix: PARTNAME override ID_PART_ENTRY_NAME
When both PARTNAME and ID_PART_ENTRY_NAME are specified, rook takes PARTNAME in account, overriding ID_PART_ENTRY_NAME. As PARTNAME is not always updated by the kernel after sgdisk --change-name, it's better to do the opposite. It also makes GetDevicePartitions coherent with parsePartLabel (called by GetPartitionLabel). Signed-off-by: Mikaël Cluseau <mikael.cluseau@gmail.com>
This commit is contained in:
1 parent
b759b40364
commit
0267433484
2 files changed
+3
-2
No files matched your search
@@ -134,10 +134,10 @@ func GetDevicePartitions(device string, executor exec.Executor) (partitions []Pa
|
||||
if err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
if v, ok := info["ID_PART_ENTRY_NAME"]; ok {
|
||||
if v, ok := info["PARTNAME"]; ok {
|
||||
p.Label = v
|
||||
}
|
||||
if v, ok := info["PARTNAME"]; ok {
|
||||
if v, ok := info["ID_PART_ENTRY_NAME"]; ok {
|
||||
p.Label = v
|
||||
}
|
||||
if v, ok := info["ID_FS_TYPE"]; ok {
|
||||
|
||||
@@ -81,6 +81,7 @@ ID_WWN_WITH_EXTENSION=0x600140568c0bd28d4ee43769387c9f02
|
||||
MAJOR=8
|
||||
MINOR=35
|
||||
PARTN=3
|
||||
PARTNAME=Linux filesystem
|
||||
SUBSYSTEM=block
|
||||
`
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user