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
3a0fb103
Commit
3a0fb103
authored
Apr 16, 2018
by
andyzhangx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix devicePath update issue in Azure WaitForAttach func
add WaitForAttach logging
parent
860403da
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
6 deletions
+15
-6
attacher.go
pkg/volume/azure_dd/attacher.go
+15
-6
No files found.
pkg/volume/azure_dd/attacher.go
View file @
3a0fb103
...
@@ -150,27 +150,36 @@ func (a *azureDiskAttacher) VolumesAreAttached(specs []*volume.Spec, nodeName ty
...
@@ -150,27 +150,36 @@ func (a *azureDiskAttacher) VolumesAreAttached(specs []*volume.Spec, nodeName ty
func
(
a
*
azureDiskAttacher
)
WaitForAttach
(
spec
*
volume
.
Spec
,
devicePath
string
,
_
*
v1
.
Pod
,
timeout
time
.
Duration
)
(
string
,
error
)
{
func
(
a
*
azureDiskAttacher
)
WaitForAttach
(
spec
*
volume
.
Spec
,
devicePath
string
,
_
*
v1
.
Pod
,
timeout
time
.
Duration
)
(
string
,
error
)
{
var
err
error
var
err
error
lun
,
err
:=
strconv
.
Atoi
(
devicePath
)
volumeSource
,
err
:=
getVolumeSource
(
spec
)
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
fmt
.
Errorf
(
"azureDisk - Wait for attach expect device path as a lun number, instead got: %s (%v)"
,
devicePath
,
err
)
return
""
,
err
}
}
volumeSource
,
err
:=
getVolumeSource
(
spec
)
diskController
,
err
:=
getDiskController
(
a
.
plugin
.
host
)
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
err
return
""
,
err
}
}
nodeName
:=
types
.
NodeName
(
a
.
plugin
.
host
.
GetHostName
())
diskName
:=
volumeSource
.
DiskName
glog
.
V
(
5
)
.
Infof
(
"azureDisk - WaitForAttach: begin to GetDiskLun by diskName(%s), DataDiskURI(%s), nodeName(%s), devicePath(%s)"
,
diskName
,
volumeSource
.
DataDiskURI
,
nodeName
,
devicePath
)
lun
,
err
:=
diskController
.
GetDiskLun
(
diskName
,
volumeSource
.
DataDiskURI
,
nodeName
)
if
err
!=
nil
{
return
""
,
err
}
glog
.
V
(
5
)
.
Infof
(
"azureDisk - WaitForAttach: GetDiskLun succeeded, got lun(%v)"
,
lun
)
exec
:=
a
.
plugin
.
host
.
GetExec
(
a
.
plugin
.
GetPluginName
())
exec
:=
a
.
plugin
.
host
.
GetExec
(
a
.
plugin
.
GetPluginName
())
io
:=
&
osIOHandler
{}
io
:=
&
osIOHandler
{}
scsiHostRescan
(
io
,
exec
)
scsiHostRescan
(
io
,
exec
)
diskName
:=
volumeSource
.
DiskName
nodeName
:=
a
.
plugin
.
host
.
GetHostName
()
newDevicePath
:=
""
newDevicePath
:=
""
err
=
wait
.
Poll
(
1
*
time
.
Second
,
timeout
,
func
()
(
bool
,
error
)
{
err
=
wait
.
Poll
(
1
*
time
.
Second
,
timeout
,
func
()
(
bool
,
error
)
{
if
newDevicePath
,
err
=
findDiskByLun
(
lun
,
io
,
exec
);
err
!=
nil
{
if
newDevicePath
,
err
=
findDiskByLun
(
int
(
lun
)
,
io
,
exec
);
err
!=
nil
{
return
false
,
fmt
.
Errorf
(
"azureDisk - WaitForAttach ticker failed node (%s) disk (%s) lun(%v) err(%s)"
,
nodeName
,
diskName
,
lun
,
err
)
return
false
,
fmt
.
Errorf
(
"azureDisk - WaitForAttach ticker failed node (%s) disk (%s) lun(%v) err(%s)"
,
nodeName
,
diskName
,
lun
,
err
)
}
}
...
...
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