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
fffd152e
Commit
fffd152e
authored
Dec 15, 2017
by
David Zhu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed kubelet error message to be more descriptive. Added Attach success event…
Fixed kubelet error message to be more descriptive. Added Attach success event for help in debugging.
parent
68c857e2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
2 deletions
+25
-2
event.go
pkg/kubelet/events/event.go
+1
-0
volume_manager.go
pkg/kubelet/volumemanager/volume_manager.go
+19
-2
operation_generator.go
pkg/volume/util/operationexecutor/operation_generator.go
+5
-0
No files found.
pkg/kubelet/events/event.go
View file @
fffd152e
...
...
@@ -59,6 +59,7 @@ const (
FailedUnmapDevice
=
"FailedUnmapDevice"
WarnAlreadyMountedVolume
=
"AlreadyMountedVolume"
SuccessfulDetachVolume
=
"SuccessfulDetachVolume"
SuccessfulAttachVolume
=
"SuccessfulAttachVolume"
SuccessfulMountVolume
=
"SuccessfulMountVolume"
SuccessfulUnMountVolume
=
"SuccessfulUnMountVolume"
HostPortConflict
=
"HostPortConflict"
...
...
pkg/kubelet/volumemanager/volume_manager.go
View file @
fffd152e
...
...
@@ -357,21 +357,38 @@ func (vm *volumeManager) WaitForAttachAndMount(pod *v1.Pod) error {
// Timeout expired
unmountedVolumes
:=
vm
.
getUnmountedVolumes
(
uniquePodName
,
expectedVolumes
)
// Also get unattached volumes for error message
unattachedVolumes
:=
vm
.
getUnattachedVolumes
(
expectedVolumes
)
if
len
(
unmountedVolumes
)
==
0
{
return
nil
}
return
fmt
.
Errorf
(
"timeout expired waiting for volumes to attach
/mount for pod %q/%q. list of unattached/unmount
ed volumes=%v"
,
"timeout expired waiting for volumes to attach
or mount for pod %q/%q. list of unmounted volumes=%v. list of unattach
ed volumes=%v"
,
pod
.
Namespace
,
pod
.
Name
,
unmountedVolumes
)
unmountedVolumes
,
unattachedVolumes
)
}
glog
.
V
(
3
)
.
Infof
(
"All volumes are attached and mounted for pod %q"
,
format
.
Pod
(
pod
))
return
nil
}
// getUnattachedVolumes returns a list of the volumes that are expected to be attached but
// are not currently attached to the node
func
(
vm
*
volumeManager
)
getUnattachedVolumes
(
expectedVolumes
[]
string
)
[]
string
{
unattachedVolumes
:=
[]
string
{}
for
_
,
volume
:=
range
expectedVolumes
{
if
!
vm
.
actualStateOfWorld
.
VolumeExists
(
v1
.
UniqueVolumeName
(
volume
))
{
unattachedVolumes
=
append
(
unattachedVolumes
,
volume
)
}
}
return
unattachedVolumes
}
// verifyVolumesMountedFunc returns a method that returns true when all expected
// volumes are mounted.
func
(
vm
*
volumeManager
)
verifyVolumesMountedFunc
(
podName
types
.
UniquePodName
,
expectedVolumes
[]
string
)
wait
.
ConditionFunc
{
...
...
pkg/volume/util/operationexecutor/operation_generator.go
View file @
fffd152e
...
...
@@ -305,6 +305,11 @@ func (og *operationGenerator) GenerateAttachVolumeFunc(
return
detailedErr
}
// Successful attach event is useful for user debugging
simpleMsg
,
_
:=
volumeToAttach
.
GenerateMsg
(
"AttachVolume.Attach succeeded"
,
""
)
for
_
,
pod
:=
range
volumeToAttach
.
ScheduledPods
{
og
.
recorder
.
Eventf
(
pod
,
v1
.
EventTypeNormal
,
kevents
.
SuccessfulAttachVolume
,
simpleMsg
)
}
glog
.
Infof
(
volumeToAttach
.
GenerateMsgDetailed
(
"AttachVolume.Attach succeeded"
,
""
))
// Update actual state of world
...
...
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