Skip to content

Commit e2bcf28

Browse files
authored
fixed retrieve clusterID fron nqn (#191)
1 parent 6f89bd8 commit e2bcf28

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/util/initiator.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,10 @@ func getSubsystemsForDevice(devicePath string) ([]subsystemResponse, error) {
522522
func getLvolIDFromNQN(nqn string) (clusterID, lvolID string) {
523523
parts := strings.Split(nqn, ":lvol:")
524524
if len(parts) > 1 {
525-
return parts[0], parts[1]
525+
subparts := strings.Split(parts[0], ":")
526+
clusterID := subparts[len(subparts)-1]
527+
lvolID := parts[1]
528+
return clusterID, lvolID
526529
}
527530
return "", ""
528531
}

0 commit comments

Comments
 (0)