From 408d67dcc53e2f7c65a9ca53f2de537814fe45f6 Mon Sep 17 00:00:00 2001 From: Jan Safranek Date: Tue, 23 Mar 2021 18:54:07 +0100 Subject: [PATCH] Fix mounting partitions on NVMe devices --- pkg/volume/awsebs/aws_util.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/volume/awsebs/aws_util.go b/pkg/volume/awsebs/aws_util.go index 4a3ae61e955..e5f8e7fc613 100644 --- a/pkg/volume/awsebs/aws_util.go +++ b/pkg/volume/awsebs/aws_util.go @@ -41,8 +41,9 @@ import ( ) const ( - diskPartitionSuffix = "" - checkSleepDuration = time.Second + diskPartitionSuffix = "" + nvmeDiskPartitionSuffix = "p" + checkSleepDuration = time.Second ) // AWSDiskUtil provides operations for EBS volume. @@ -240,6 +241,9 @@ func getDiskByIDPaths(volumeID aws.KubernetesVolumeID, partition string, deviceP if err != nil { klog.Warningf("error looking for nvme volume %q: %v", volumeID, err) } else if nvmePath != "" { + if partition != "" { + nvmePath = nvmePath + nvmeDiskPartitionSuffix + partition + } devicePaths = append(devicePaths, nvmePath) } }