Merge pull request #41626 from derekwaynecarr/improve-kubelet-volume-logging

Automatic merge from submit-queue (batch tested with PRs 41649, 41658, 41266, 41371, 41626)

Understand why kubelet cannot cleanup orphaned pod dirs

**What this PR does / why we need it**:
Understand if we are unable to clean up orphaned pod directories due to a failure to read the directory versus paths still existing to improve ability to debug error situations.
This commit is contained in:
Kubernetes Submit Queue 2017-02-17 16:38:41 -08:00 committed by GitHub
commit 7bbafd259c

View File

@ -106,8 +106,12 @@ func (kl *Kubelet) cleanupOrphanedPodDirs(
}
// If there are still volume directories, do not delete directory
volumePaths, err := kl.getPodVolumePathListFromDisk(uid)
if err != nil || len(volumePaths) > 0 {
glog.Errorf("Orphaned pod %q found, but error %v occured during reading volume dir from disk", uid, err)
if err != nil {
glog.Errorf("Orphaned pod %q found, but error %v occurred during reading volume dir from disk", uid, err)
continue
}
if len(volumePaths) > 0 {
glog.Errorf("Orphaned pod %q found, but volume paths are still present on disk.", uid)
continue
}
glog.V(3).Infof("Orphaned pod %q found, removing", uid)