Refactor qos package

Signed-off-by: Buddha Prakash <buddhap@google.com>
This commit is contained in:
Buddha Prakash
2016-06-20 18:28:42 -07:00
parent 5b50b74390
commit c3551ae6cd
12 changed files with 60 additions and 38 deletions

View File

@@ -18,7 +18,6 @@ package qos
import (
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/kubelet/qos/util"
)
const (
@@ -36,11 +35,11 @@ const (
// and 1000. Containers with higher OOM scores are killed if the system runs out of memory.
// See https://lwn.net/Articles/391222/ for more information.
func GetContainerOOMScoreAdjust(pod *api.Pod, container *api.Container, memoryCapacity int64) int {
switch util.GetPodQos(pod) {
case util.Guaranteed:
switch GetPodQos(pod) {
case Guaranteed:
// Guaranteed containers should be the last to get killed.
return guaranteedOOMScoreAdj
case util.BestEffort:
case BestEffort:
return besteffortOOMScoreAdj
}