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
32333b0f
Unverified
Commit
32333b0f
authored
Feb 26, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
Feb 26, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #74524 from bertinatto/iscsi_iface_exists
Don't fail if iface is being used by iSCSI session
parents
d476f20d
d60d7e90
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
+13
-2
BUILD
pkg/volume/iscsi/BUILD
+1
-0
iscsi_util.go
pkg/volume/iscsi/iscsi_util.go
+12
-2
No files found.
pkg/volume/iscsi/BUILD
View file @
32333b0f
...
...
@@ -27,6 +27,7 @@ go_library(
"//staging/src/k8s.io/apimachinery/pkg/types:go_default_library",
"//staging/src/k8s.io/apiserver/pkg/util/feature:go_default_library",
"//vendor/k8s.io/klog:go_default_library",
"//vendor/k8s.io/utils/exec:go_default_library",
"//vendor/k8s.io/utils/keymutex:go_default_library",
"//vendor/k8s.io/utils/strings:go_default_library",
],
...
...
pkg/volume/iscsi/iscsi_util.go
View file @
32333b0f
...
...
@@ -34,6 +34,7 @@ import (
"k8s.io/kubernetes/pkg/util/mount"
"k8s.io/kubernetes/pkg/volume"
volumeutil
"k8s.io/kubernetes/pkg/volume/util"
utilexec
"k8s.io/utils/exec"
)
const
(
...
...
@@ -51,6 +52,10 @@ const (
// How many seconds to wait for a multipath device if at least two paths are available.
multipathDeviceTimeout
=
10
// 'iscsiadm' error code stating that a session is logged in
// See https://github.com/open-iscsi/open-iscsi/blob/7d121d12ad6ba7783308c25ffd338a9fa0cc402b/include/iscsi_err.h#L37-L38
iscsiadmErrorSessExists
=
15
)
var
(
...
...
@@ -872,8 +877,13 @@ func cloneIface(b iscsiDiskMounter, newIface string) error {
// create new iface
out
,
err
=
b
.
exec
.
Run
(
"iscsiadm"
,
"-m"
,
"iface"
,
"-I"
,
newIface
,
"-o"
,
"new"
)
if
err
!=
nil
{
lastErr
=
fmt
.
Errorf
(
"iscsi: failed to create new iface: %s (%v)"
,
string
(
out
),
err
)
return
lastErr
exit
,
ok
:=
err
.
(
utilexec
.
ExitError
)
if
ok
&&
exit
.
ExitStatus
()
==
iscsiadmErrorSessExists
{
klog
.
Infof
(
"iscsi: there is a session already logged in with iface %s"
,
newIface
)
}
else
{
lastErr
=
fmt
.
Errorf
(
"iscsi: failed to create new iface: %s (%v)"
,
string
(
out
),
err
)
return
lastErr
}
}
// update new iface records
for
key
,
val
:=
range
params
{
...
...
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