Skip to content
Permalink
Browse files

Support iqn as well as eui format for iSCSI entity names.

Supported formats are :
iqn.<date code>.<reversed domain>[:<optional suffix>]

eui.<eui-64 identifier>
  • Loading branch information...
anish committed Nov 24, 2015
1 parent 949cf9e commit 18c82f743cd10785b19f1a6bb58c7374caea2aa8
Showing with 8 additions and 0 deletions.
  1. +3 −0 pkg/volume/iscsi/iscsi_util.go
  2. +5 −0 pkg/volume/iscsi/iscsi_util_test.go
@@ -179,6 +179,9 @@ func extractPortalAndIqn(device string) (string, string, error) {
}
portal := device[0:ind1]
ind2 := strings.Index(device, "iqn.")
if ind2 < 0 {
ind2 = strings.Index(device, "eui.")
}
if ind2 < 0 {
return "", "", fmt.Errorf("iscsi detach disk: no iqn in %s", device)
}
@@ -68,4 +68,9 @@ func TestExtractPortalAndIqn(t *testing.T) {
if err != nil || portal != "127.0.0.1:3260" || iqn != "iqn.2014-12.com.example:test.tgt00" {
t.Errorf("extractPortalAndIqn: got %v %s %s", err, portal, iqn)
}
devicePath = "127.0.0.1:3260-eui.02004567A425678D-lun-0"
portal, iqn, err = extractPortalAndIqn(devicePath)
if err != nil || portal != "127.0.0.1:3260" || iqn != "eui.02004567A425678D" {
t.Errorf("extractPortalAndIqn: got %v %s %s", err, portal, iqn)
}
}

1 comment on commit 18c82f7

@k8s-teamcity-mesosphere

This comment has been minimized.

Copy link

k8s-teamcity-mesosphere commented on 18c82f7 Nov 24, 2015

TeamCity OSS :: Kubernetes Mesos :: 4 - Smoke Tests Build 6503 outcome was SUCCESS
Summary: Tests passed: 1, ignored: 201 Build time: 00:04:42

Please sign in to comment.
You can’t perform that action at this time.