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
d60d7e90
Commit
d60d7e90
authored
Feb 22, 2019
by
Fabio Bertinatto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't fail if iface is being used by iSCSI session
parent
6de09f69
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 @
d60d7e90
...
@@ -27,6 +27,7 @@ go_library(
...
@@ -27,6 +27,7 @@ go_library(
"//staging/src/k8s.io/apimachinery/pkg/types:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/types:go_default_library",
"//staging/src/k8s.io/apiserver/pkg/util/feature:go_default_library",
"//staging/src/k8s.io/apiserver/pkg/util/feature:go_default_library",
"//vendor/k8s.io/klog: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/keymutex:go_default_library",
"//vendor/k8s.io/utils/strings:go_default_library",
"//vendor/k8s.io/utils/strings:go_default_library",
],
],
...
...
pkg/volume/iscsi/iscsi_util.go
View file @
d60d7e90
...
@@ -34,6 +34,7 @@ import (
...
@@ -34,6 +34,7 @@ import (
"k8s.io/kubernetes/pkg/util/mount"
"k8s.io/kubernetes/pkg/util/mount"
"k8s.io/kubernetes/pkg/volume"
"k8s.io/kubernetes/pkg/volume"
volumeutil
"k8s.io/kubernetes/pkg/volume/util"
volumeutil
"k8s.io/kubernetes/pkg/volume/util"
utilexec
"k8s.io/utils/exec"
)
)
const
(
const
(
...
@@ -51,6 +52,10 @@ const (
...
@@ -51,6 +52,10 @@ const (
// How many seconds to wait for a multipath device if at least two paths are available.
// How many seconds to wait for a multipath device if at least two paths are available.
multipathDeviceTimeout
=
10
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
(
var
(
...
@@ -872,8 +877,13 @@ func cloneIface(b iscsiDiskMounter, newIface string) error {
...
@@ -872,8 +877,13 @@ func cloneIface(b iscsiDiskMounter, newIface string) error {
// create new iface
// create new iface
out
,
err
=
b
.
exec
.
Run
(
"iscsiadm"
,
"-m"
,
"iface"
,
"-I"
,
newIface
,
"-o"
,
"new"
)
out
,
err
=
b
.
exec
.
Run
(
"iscsiadm"
,
"-m"
,
"iface"
,
"-I"
,
newIface
,
"-o"
,
"new"
)
if
err
!=
nil
{
if
err
!=
nil
{
lastErr
=
fmt
.
Errorf
(
"iscsi: failed to create new iface: %s (%v)"
,
string
(
out
),
err
)
exit
,
ok
:=
err
.
(
utilexec
.
ExitError
)
return
lastErr
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
// update new iface records
for
key
,
val
:=
range
params
{
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