mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-02 11:18:16 +00:00
test: improved kubelet disk_manager coverage.
This commit is contained in:
@@ -28,6 +28,9 @@ import (
|
||||
|
||||
// Manages policy for diskspace management for disks holding docker images and root fs.
|
||||
|
||||
// mb is used to easily convert an int to an mb
|
||||
const mb = 1024 * 1024
|
||||
|
||||
// Implementation is thread-safe.
|
||||
type diskSpaceManager interface {
|
||||
// Checks the available disk space
|
||||
@@ -107,8 +110,6 @@ func (dm *realDiskSpaceManager) isSpaceAvailable(fsType string, threshold int, f
|
||||
return true, fmt.Errorf("wrong available space for %q: %+v", fsType, fsInfo)
|
||||
}
|
||||
|
||||
const mb = int64(1024 * 1024)
|
||||
|
||||
if fsInfo.Available < int64(threshold)*mb {
|
||||
glog.Infof("Running out of space on disk for %q: available %d MB, threshold %d MB", fsType, fsInfo.Available/mb, threshold)
|
||||
return false, nil
|
||||
|
||||
Reference in New Issue
Block a user