iscsi: if port is not provided, use default 3260 for target portal

Signed-off-by: Huamin Chen <hchen@redhat.com>
pull/6/head
Huamin Chen 2015-10-13 13:31:59 -04:00
parent e929977ff3
commit 340cfcc284
1 changed files with 6 additions and 1 deletions

View File

@ -18,6 +18,7 @@ package iscsi
import (
"strconv"
"strings"
"github.com/golang/glog"
"k8s.io/kubernetes/pkg/api"
@ -94,12 +95,16 @@ func (plugin *iscsiPlugin) newBuilderInternal(spec *volume.Spec, podUID types.UI
}
lun := strconv.Itoa(iscsi.Lun)
portal := iscsi.TargetPortal
if !strings.Contains(portal, ":") {
portal = iscsi.TargetPortal + ":3260"
}
return &iscsiDiskBuilder{
iscsiDisk: &iscsiDisk{
podUID: podUID,
volName: spec.Name(),
portal: iscsi.TargetPortal,
portal: portal,
iqn: iscsi.IQN,
lun: lun,
manager: manager,