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
da6cc5d7
Commit
da6cc5d7
authored
Dec 21, 2017
by
Brendan Burns
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Print/return the text from a number of errors that were silent before.
parent
c13a2aba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
attacher.go
pkg/volume/azure_dd/attacher.go
+7
-7
No files found.
pkg/volume/azure_dd/attacher.go
View file @
da6cc5d7
...
@@ -60,14 +60,14 @@ var getLunMutex = keymutex.NewKeyMutex()
...
@@ -60,14 +60,14 @@ var getLunMutex = keymutex.NewKeyMutex()
func
(
a
*
azureDiskAttacher
)
Attach
(
spec
*
volume
.
Spec
,
nodeName
types
.
NodeName
)
(
string
,
error
)
{
func
(
a
*
azureDiskAttacher
)
Attach
(
spec
*
volume
.
Spec
,
nodeName
types
.
NodeName
)
(
string
,
error
)
{
volumeSource
,
err
:=
getVolumeSource
(
spec
)
volumeSource
,
err
:=
getVolumeSource
(
spec
)
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
Warningf
(
"failed to get azure disk spec
"
)
glog
.
Warningf
(
"failed to get azure disk spec
(%v)"
,
err
)
return
""
,
err
return
""
,
err
}
}
instanceid
,
err
:=
a
.
cloud
.
InstanceID
(
nodeName
)
instanceid
,
err
:=
a
.
cloud
.
InstanceID
(
nodeName
)
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
Warningf
(
"failed to get azure instance id
"
)
glog
.
Warningf
(
"failed to get azure instance id
(%v)"
,
err
)
return
""
,
fmt
.
Errorf
(
"failed to get azure instance id for node %q
"
,
nodeName
)
return
""
,
fmt
.
Errorf
(
"failed to get azure instance id for node %q
(%v)"
,
nodeName
,
err
)
}
}
if
ind
:=
strings
.
LastIndex
(
instanceid
,
"/"
);
ind
>=
0
{
if
ind
:=
strings
.
LastIndex
(
instanceid
,
"/"
);
ind
>=
0
{
instanceid
=
instanceid
[(
ind
+
1
)
:
]
instanceid
=
instanceid
[(
ind
+
1
)
:
]
...
@@ -96,8 +96,8 @@ func (a *azureDiskAttacher) Attach(spec *volume.Spec, nodeName types.NodeName) (
...
@@ -96,8 +96,8 @@ func (a *azureDiskAttacher) Attach(spec *volume.Spec, nodeName types.NodeName) (
lun
,
err
=
diskController
.
GetNextDiskLun
(
nodeName
)
lun
,
err
=
diskController
.
GetNextDiskLun
(
nodeName
)
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
Warningf
(
"no LUN available for instance %q
"
,
nodeName
)
glog
.
Warningf
(
"no LUN available for instance %q
(%v)"
,
nodeName
,
err
)
return
""
,
fmt
.
Errorf
(
"all LUNs are used, cannot attach volume %q to instance %q
"
,
volumeSource
.
DiskName
,
instanceid
)
return
""
,
fmt
.
Errorf
(
"all LUNs are used, cannot attach volume %q to instance %q
(%v)"
,
volumeSource
.
DiskName
,
instanceid
,
err
)
}
}
glog
.
V
(
4
)
.
Infof
(
"Trying to attach volume %q lun %d to node %q."
,
volumeSource
.
DataDiskURI
,
lun
,
nodeName
)
glog
.
V
(
4
)
.
Infof
(
"Trying to attach volume %q lun %d to node %q."
,
volumeSource
.
DataDiskURI
,
lun
,
nodeName
)
isManagedDisk
:=
(
*
volumeSource
.
Kind
==
v1
.
AzureManagedDisk
)
isManagedDisk
:=
(
*
volumeSource
.
Kind
==
v1
.
AzureManagedDisk
)
...
@@ -156,7 +156,7 @@ func (a *azureDiskAttacher) WaitForAttach(spec *volume.Spec, devicePath string,
...
@@ -156,7 +156,7 @@ func (a *azureDiskAttacher) WaitForAttach(spec *volume.Spec, devicePath string,
var
err
error
var
err
error
lun
,
err
:=
strconv
.
Atoi
(
devicePath
)
lun
,
err
:=
strconv
.
Atoi
(
devicePath
)
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
fmt
.
Errorf
(
"azureDisk - Wait for attach expect device path as a lun number, instead got: %s
"
,
devicePath
)
return
""
,
fmt
.
Errorf
(
"azureDisk - Wait for attach expect device path as a lun number, instead got: %s
(%v)"
,
devicePath
,
err
)
}
}
volumeSource
,
err
:=
getVolumeSource
(
spec
)
volumeSource
,
err
:=
getVolumeSource
(
spec
)
...
@@ -260,7 +260,7 @@ func (d *azureDiskDetacher) Detach(diskURI string, nodeName types.NodeName) erro
...
@@ -260,7 +260,7 @@ func (d *azureDiskDetacher) Detach(diskURI string, nodeName types.NodeName) erro
instanceid
,
err
:=
d
.
cloud
.
InstanceID
(
nodeName
)
instanceid
,
err
:=
d
.
cloud
.
InstanceID
(
nodeName
)
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
Warningf
(
"no instance id for node %q, skip detaching
"
,
nodeName
)
glog
.
Warningf
(
"no instance id for node %q, skip detaching
(%v)"
,
nodeName
,
err
)
return
nil
return
nil
}
}
if
ind
:=
strings
.
LastIndex
(
instanceid
,
"/"
);
ind
>=
0
{
if
ind
:=
strings
.
LastIndex
(
instanceid
,
"/"
);
ind
>=
0
{
...
...
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