mirror of https://github.com/k3s-io/k3s
iscsi: if port is not provided, use default 3260 for target portal
Signed-off-by: Huamin Chen <hchen@redhat.com>pull/6/head
parent
e929977ff3
commit
340cfcc284
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue