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
562e5c6f
Commit
562e5c6f
authored
Aug 31, 2018
by
wenjgao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add lun info when construct iscsi volumeSpec from mountPath
parent
07f68ea8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
iscsi.go
pkg/volume/iscsi/iscsi.go
+9
-0
No files found.
pkg/volume/iscsi/iscsi.go
View file @
562e5c6f
...
...
@@ -231,6 +231,14 @@ func (plugin *iscsiPlugin) ConstructVolumeSpec(volumeName, mountPath string) (*v
if
err
!=
nil
{
return
nil
,
err
}
arr
:=
strings
.
Split
(
device
,
"-lun-"
)
if
len
(
arr
)
<
2
{
return
nil
,
fmt
.
Errorf
(
"failed to retrieve lun from globalPDPath: %v"
,
globalPDPath
)
}
lun
,
err
:=
strconv
.
Atoi
(
arr
[
1
])
if
err
!=
nil
{
return
nil
,
err
}
iface
,
_
:=
extractIface
(
globalPDPath
)
iscsiVolume
:=
&
v1
.
Volume
{
Name
:
volumeName
,
...
...
@@ -238,6 +246,7 @@ func (plugin *iscsiPlugin) ConstructVolumeSpec(volumeName, mountPath string) (*v
ISCSI
:
&
v1
.
ISCSIVolumeSource
{
TargetPortal
:
bkpPortal
,
IQN
:
iqn
,
Lun
:
int32
(
lun
),
ISCSIInterface
:
iface
,
},
},
...
...
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