Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
407f9b9e
Commit
407f9b9e
authored
Oct 15, 2015
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #15555 from rootfs/iscsi-def-port
Auto commit by PR queue bot
parents
a3f2ba2e
76df88f6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
2 deletions
+20
-2
iscsi.go
pkg/volume/iscsi/iscsi.go
+11
-2
iscsi_test.go
pkg/volume/iscsi/iscsi_test.go
+9
-0
No files found.
pkg/volume/iscsi/iscsi.go
View file @
407f9b9e
...
...
@@ -18,6 +18,7 @@ package iscsi
import
(
"strconv"
"strings"
"github.com/golang/glog"
"k8s.io/kubernetes/pkg/api"
...
...
@@ -94,16 +95,17 @@ func (plugin *iscsiPlugin) newBuilderInternal(spec *volume.Spec, podUID types.UI
}
lun
:=
strconv
.
Itoa
(
iscsi
.
Lun
)
portal
:=
portalBuilder
(
iscsi
.
TargetPortal
)
return
&
iscsiDiskBuilder
{
iscsiDisk
:
&
iscsiDisk
{
podUID
:
podUID
,
volName
:
spec
.
Name
(),
portal
:
iscsi
.
TargetP
ortal
,
portal
:
p
ortal
,
iqn
:
iscsi
.
IQN
,
lun
:
lun
,
manager
:
manager
,
mounter
:
mounter
,
mounter
:
&
mount
.
SafeFormatAndMount
{
mounter
,
exec
.
New
()}
,
plugin
:
plugin
},
fsType
:
iscsi
.
FSType
,
readOnly
:
readOnly
,
...
...
@@ -188,3 +190,10 @@ func (c *iscsiDiskCleaner) TearDown() error {
func
(
c
*
iscsiDiskCleaner
)
TearDownAt
(
dir
string
)
error
{
return
diskTearDown
(
c
.
manager
,
*
c
,
dir
,
c
.
mounter
)
}
func
portalBuilder
(
portal
string
)
string
{
if
!
strings
.
Contains
(
portal
,
":"
)
{
portal
=
portal
+
":3260"
}
return
portal
}
pkg/volume/iscsi/iscsi_test.go
View file @
407f9b9e
...
...
@@ -250,3 +250,12 @@ func TestPersistentClaimReadOnlyFlag(t *testing.T) {
t
.
Errorf
(
"Expected true for builder.IsReadOnly"
)
}
}
func
TestPortalBuilder
(
t
*
testing
.
T
)
{
if
portal
:=
portalBuilder
(
"127.0.0.1"
);
portal
!=
"127.0.0.1:3260"
{
t
.
Errorf
(
"wrong portal: %s"
,
portal
)
}
if
portal
:=
portalBuilder
(
"127.0.0.1:3260"
);
portal
!=
"127.0.0.1:3260"
{
t
.
Errorf
(
"wrong portal: %s"
,
portal
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment