mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-14 13:45:06 +00:00
iscsi: if port is not provided, use default 3260 for target portal
Signed-off-by: Huamin Chen <hchen@redhat.com>
This commit is contained in:
@@ -18,6 +18,7 @@ package iscsi
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/golang/glog"
|
"github.com/golang/glog"
|
||||||
"k8s.io/kubernetes/pkg/api"
|
"k8s.io/kubernetes/pkg/api"
|
||||||
@@ -94,12 +95,16 @@ func (plugin *iscsiPlugin) newBuilderInternal(spec *volume.Spec, podUID types.UI
|
|||||||
}
|
}
|
||||||
|
|
||||||
lun := strconv.Itoa(iscsi.Lun)
|
lun := strconv.Itoa(iscsi.Lun)
|
||||||
|
portal := iscsi.TargetPortal
|
||||||
|
if !strings.Contains(portal, ":") {
|
||||||
|
portal = iscsi.TargetPortal + ":3260"
|
||||||
|
}
|
||||||
|
|
||||||
return &iscsiDiskBuilder{
|
return &iscsiDiskBuilder{
|
||||||
iscsiDisk: &iscsiDisk{
|
iscsiDisk: &iscsiDisk{
|
||||||
podUID: podUID,
|
podUID: podUID,
|
||||||
volName: spec.Name(),
|
volName: spec.Name(),
|
||||||
portal: iscsi.TargetPortal,
|
portal: portal,
|
||||||
iqn: iscsi.IQN,
|
iqn: iscsi.IQN,
|
||||||
lun: lun,
|
lun: lun,
|
||||||
manager: manager,
|
manager: manager,
|
||||||
|
Reference in New Issue
Block a user