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
ad1e021d
Unverified
Commit
ad1e021d
authored
Feb 21, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
Feb 21, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #74306 from jsafrane/fix-iscsi-deployment
Fix scanning of failed targets
parents
651faf2e
dc46f483
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
7 deletions
+14
-7
device_util_linux.go
pkg/volume/util/device_util_linux.go
+14
-7
No files found.
pkg/volume/util/device_util_linux.go
View file @
ad1e021d
...
@@ -21,10 +21,11 @@ package util
...
@@ -21,10 +21,11 @@ package util
import
(
import
(
"errors"
"errors"
"fmt"
"fmt"
"k8s.io/klog"
"path"
"path"
"strconv"
"strconv"
"strings"
"strings"
"k8s.io/klog"
)
)
// FindMultipathDeviceForDevice given a device name like /dev/sdx, find the devicemapper parent
// FindMultipathDeviceForDevice given a device name like /dev/sdx, find the devicemapper parent
...
@@ -135,7 +136,8 @@ func (handler *deviceHandler) GetISCSIPortalHostMapForTarget(targetIqn string) (
...
@@ -135,7 +136,8 @@ func (handler *deviceHandler) GetISCSIPortalHostMapForTarget(targetIqn string) (
targetNamePath
:=
sessionPath
+
"/iscsi_session/"
+
sessionName
+
"/targetname"
targetNamePath
:=
sessionPath
+
"/iscsi_session/"
+
sessionName
+
"/targetname"
targetName
,
err
:=
io
.
ReadFile
(
targetNamePath
)
targetName
,
err
:=
io
.
ReadFile
(
targetNamePath
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
klog
.
Infof
(
"Failed to process session %s, assuming this session is unavailable: %s"
,
sessionName
,
err
)
continue
}
}
// Ignore hosts that don't matchthe target we were looking for.
// Ignore hosts that don't matchthe target we were looking for.
...
@@ -147,7 +149,8 @@ func (handler *deviceHandler) GetISCSIPortalHostMapForTarget(targetIqn string) (
...
@@ -147,7 +149,8 @@ func (handler *deviceHandler) GetISCSIPortalHostMapForTarget(targetIqn string) (
// for the iSCSI connection.
// for the iSCSI connection.
dirs2
,
err
:=
io
.
ReadDir
(
sessionPath
)
dirs2
,
err
:=
io
.
ReadDir
(
sessionPath
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
klog
.
Infof
(
"Failed to process session %s, assuming this session is unavailable: %s"
,
sessionName
,
err
)
continue
}
}
for
_
,
dir2
:=
range
dirs2
{
for
_
,
dir2
:=
range
dirs2
{
// Skip over files that aren't the connection
// Skip over files that aren't the connection
...
@@ -164,25 +167,29 @@ func (handler *deviceHandler) GetISCSIPortalHostMapForTarget(targetIqn string) (
...
@@ -164,25 +167,29 @@ func (handler *deviceHandler) GetISCSIPortalHostMapForTarget(targetIqn string) (
addrPath
:=
connectionPath
+
"/address"
addrPath
:=
connectionPath
+
"/address"
addr
,
err
:=
io
.
ReadFile
(
addrPath
)
addr
,
err
:=
io
.
ReadFile
(
addrPath
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
klog
.
Infof
(
"Failed to process connection %s, assuming this connection is unavailable: %s"
,
dirName
,
err
)
continue
}
}
portPath
:=
connectionPath
+
"/port"
portPath
:=
connectionPath
+
"/port"
port
,
err
:=
io
.
ReadFile
(
portPath
)
port
,
err
:=
io
.
ReadFile
(
portPath
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
klog
.
Infof
(
"Failed to process connection %s, assuming this connection is unavailable: %s"
,
dirName
,
err
)
continue
}
}
persistentAddrPath
:=
connectionPath
+
"/persistent_address"
persistentAddrPath
:=
connectionPath
+
"/persistent_address"
persistentAddr
,
err
:=
io
.
ReadFile
(
persistentAddrPath
)
persistentAddr
,
err
:=
io
.
ReadFile
(
persistentAddrPath
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
klog
.
Infof
(
"Failed to process connection %s, assuming this connection is unavailable: %s"
,
dirName
,
err
)
continue
}
}
persistentPortPath
:=
connectionPath
+
"/persistent_port"
persistentPortPath
:=
connectionPath
+
"/persistent_port"
persistentPort
,
err
:=
io
.
ReadFile
(
persistentPortPath
)
persistentPort
,
err
:=
io
.
ReadFile
(
persistentPortPath
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
klog
.
Infof
(
"Failed to process connection %s, assuming this connection is unavailable: %s"
,
dirName
,
err
)
continue
}
}
// Add entries to the map for both the current and persistent portals
// Add entries to the map for both the current and persistent portals
...
...
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