Update godeps

This commit is contained in:
Manuel de Brito Fontes 2016-11-10 19:57:28 -03:00
parent 1c8773fc98
commit 1bc383f9c5
1723 changed files with 287976 additions and 411028 deletions

41
vendor/k8s.io/kubernetes/pkg/kubelet/qos/BUILD generated vendored Normal file
View file

@ -0,0 +1,41 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_binary",
"go_library",
"go_test",
"cgo_library",
)
go_library(
name = "go_default_library",
srcs = [
"doc.go",
"policy.go",
"qos.go",
"types.go",
],
tags = ["automanaged"],
deps = [
"//pkg/api:go_default_library",
"//pkg/api/resource:go_default_library",
"//pkg/util/sets:go_default_library",
],
)
go_test(
name = "go_default_test",
srcs = [
"policy_test.go",
"qos_test.go",
],
library = "go_default_library",
tags = ["automanaged"],
deps = [
"//pkg/api:go_default_library",
"//pkg/api/resource:go_default_library",
],
)

View file

@ -21,6 +21,10 @@ import (
)
const (
// PodInfraOOMAdj is very docker specific. For arbitrary runtime, it may not make
// sense to set sandbox level oom score, e.g. a sandbox could only be a namespace
// without a process.
// TODO: Handle infra container oom score adj in a runtime agnostic way.
PodInfraOOMAdj int = -998
KubeletOOMScoreAdj int = -999
DockerOOMScoreAdj int = -999

View file

@ -19,6 +19,7 @@ package qos
import (
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/resource"
"k8s.io/kubernetes/pkg/util/sets"
)
// isResourceGuaranteed returns true if the container's resource requirements are Guaranteed.
@ -53,6 +54,9 @@ func GetPodQOS(pod *api.Pod) QOSClass {
for _, container := range pod.Spec.Containers {
// process requests
for name, quantity := range container.Resources.Requests {
if !supportedQoSComputeResources.Has(string(name)) {
continue
}
if quantity.Cmp(zeroQuantity) == 1 {
delta := quantity.Copy()
if _, exists := requests[name]; !exists {
@ -64,8 +68,13 @@ func GetPodQOS(pod *api.Pod) QOSClass {
}
}
// process limits
qosLimitsFound := sets.NewString()
for name, quantity := range container.Resources.Limits {
if !supportedQoSComputeResources.Has(string(name)) {
continue
}
if quantity.Cmp(zeroQuantity) == 1 {
qosLimitsFound.Insert(string(name))
delta := quantity.Copy()
if _, exists := limits[name]; !exists {
limits[name] = *delta
@ -75,7 +84,8 @@ func GetPodQOS(pod *api.Pod) QOSClass {
}
}
}
if len(container.Resources.Limits) != len(supportedComputeResources) {
if len(qosLimitsFound) != len(supportedQoSComputeResources) {
isGuaranteed = false
}
}
@ -92,8 +102,7 @@ func GetPodQOS(pod *api.Pod) QOSClass {
}
}
if isGuaranteed &&
len(requests) == len(limits) &&
len(limits) == len(supportedComputeResources) {
len(requests) == len(limits) {
return Guaranteed
}
return Burstable
@ -118,17 +127,14 @@ func GetQOS(container *api.Container) QOSList {
return resourceToQOS
}
// supportedComputeResources is the list of supported compute resources
var supportedComputeResources = []api.ResourceName{
api.ResourceCPU,
api.ResourceMemory,
}
// supportedComputeResources is the list of compute resources for with QoS is supported.
var supportedQoSComputeResources = sets.NewString(string(api.ResourceCPU), string(api.ResourceMemory))
// allResources returns a set of all possible resources whose mapped key value is true if present on the container
func allResources(container *api.Container) map[api.ResourceName]bool {
resources := map[api.ResourceName]bool{}
for _, resource := range supportedComputeResources {
resources[resource] = false
for _, resource := range supportedQoSComputeResources.List() {
resources[api.ResourceName(resource)] = false
}
for resource := range container.Resources.Requests {
resources[resource] = true

38
vendor/k8s.io/kubernetes/pkg/kubelet/types/BUILD generated vendored Normal file
View file

@ -0,0 +1,38 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_binary",
"go_library",
"go_test",
"cgo_library",
)
go_library(
name = "go_default_library",
srcs = [
"constants.go",
"doc.go",
"labels.go",
"pod_update.go",
"types.go",
],
tags = ["automanaged"],
deps = ["//pkg/api:go_default_library"],
)
go_test(
name = "go_default_test",
srcs = [
"pod_update_test.go",
"types_test.go",
],
library = "go_default_library",
tags = ["automanaged"],
deps = [
"//pkg/api:go_default_library",
"//vendor:github.com/stretchr/testify/require",
],
)