mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 22:46:12 +00:00
Adding logs for file system info being not available.
This commit is contained in:
parent
507d7e5565
commit
8d6cdd5d1b
@ -2459,21 +2459,23 @@ func hasHostPortConflicts(pods []*api.Pod) bool {
|
||||
|
||||
// handleOutOfDisk detects if pods can't fit due to lack of disk space.
|
||||
func (kl *Kubelet) isOutOfDisk() bool {
|
||||
outOfDockerDisk := false
|
||||
outOfRootDisk := false
|
||||
// Check disk space once globally and reject or accept all new pods.
|
||||
withinBounds, err := kl.diskSpaceManager.IsRuntimeDiskSpaceAvailable()
|
||||
// Assume enough space in case of errors.
|
||||
if err == nil && !withinBounds {
|
||||
outOfDockerDisk = true
|
||||
if err != nil {
|
||||
glog.Errorf("Failed to check if disk space is available for the runtime: %v", err)
|
||||
} else if !withinBounds {
|
||||
return true
|
||||
}
|
||||
|
||||
withinBounds, err = kl.diskSpaceManager.IsRootDiskSpaceAvailable()
|
||||
// Assume enough space in case of errors.
|
||||
if err == nil && !withinBounds {
|
||||
outOfRootDisk = true
|
||||
if err != nil {
|
||||
glog.Errorf("Failed to check if disk space is available on the root partition: %v", err)
|
||||
} else if !withinBounds {
|
||||
return true
|
||||
}
|
||||
return outOfDockerDisk || outOfRootDisk
|
||||
return false
|
||||
}
|
||||
|
||||
// matchesNodeSelector returns true if pod matches node's labels.
|
||||
|
Loading…
Reference in New Issue
Block a user