Skip to content

Commit 4eae27a

Browse files
committed
CSI-5769: handle case of 'nvme list' command failing due to missing loaded 'nvme' and 'nvme-core' kernel modules
Signed-off-by: Ariel Kass <[email protected]>
1 parent 791b418 commit 4eae27a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

node/pkg/driver/node_utils.go

+4
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,10 @@ func (n NodeUtils) DevicesAreNvme(sysDevices []string) (bool, error) {
195195
args := []string{"list"}
196196
out, err := n.Executer.ExecuteWithTimeout(TimeOutNvmeCmd, nvmeCmd, args)
197197
if err != nil {
198+
if (err.Error() == "1") {
199+
logger.Debugf("'nvme list' failing, likely because 'nvme' and 'nvme-core' kernel modules are not loaded. Devices are certainly not NVMe in this case")
200+
return false, nil
201+
}
198202
outMessage := strings.TrimSpace(string(out))
199203
if strings.HasSuffix(outMessage, noSuchFileOrDirectoryErrorMessage) {
200204
return false, nil

0 commit comments

Comments
 (0)