orphanVolumeErrors=append(orphanVolumeErrors,fmt.Errorf("orphaned pod %q found, but error %v occurred during reading of volume-subpaths dir from disk",uid,err))
orphanVolumeErrors=append(orphanVolumeErrors,fmt.Errorf("orphaned pod %q found, but error %v occurred during reading of volume-subpaths dir from disk",uid,err))
continue
continue
}
}
ifvolumeSubpathExists{
iflen(subpathVolumePaths)>0{
orphanVolumeErrors=append(orphanVolumeErrors,fmt.Errorf("orphaned pod %q found, but volume subpaths are still present on disk",uid))
for_,subpathVolumePath:=rangesubpathVolumePaths{
iferr:=syscall.Rmdir(subpathVolumePath);err!=nil{
orphanVolumeErrors=append(orphanVolumeErrors,fmt.Errorf("orphaned pod %q found, but failed to rmdir() subpath at path %v: %v",uid,subpathVolumePath,err))
allVolumesCleanedUp=false
}else{
klog.Warningf("Cleaned up orphaned volume subpath from pod %q at %s",uid,subpathVolumePath)
}
}
}
if!allVolumesCleanedUp{
// Not all volumes were removed, so don't clean up the pod directory yet. It is likely
// that there are still mountpoints left which could stall RemoveAllOneFilesystem which
// would otherwise be called below.
// Errors for all removal operations have already been recorded, so don't add another