Fix mounting partitions on NVMe devices

This commit is contained in:
Jan Safranek 2021-03-23 18:54:07 +01:00
parent 375c9abfa2
commit 408d67dcc5

View File

@ -42,6 +42,7 @@ import (
const ( const (
diskPartitionSuffix = "" diskPartitionSuffix = ""
nvmeDiskPartitionSuffix = "p"
checkSleepDuration = time.Second checkSleepDuration = time.Second
) )
@ -240,6 +241,9 @@ func getDiskByIDPaths(volumeID aws.KubernetesVolumeID, partition string, deviceP
if err != nil { if err != nil {
klog.Warningf("error looking for nvme volume %q: %v", volumeID, err) klog.Warningf("error looking for nvme volume %q: %v", volumeID, err)
} else if nvmePath != "" { } else if nvmePath != "" {
if partition != "" {
nvmePath = nvmePath + nvmeDiskPartitionSuffix + partition
}
devicePaths = append(devicePaths, nvmePath) devicePaths = append(devicePaths, nvmePath)
} }
} }