From e58b4d4324acb82ef3f08e23892a39837c5b5ced Mon Sep 17 00:00:00 2001 From: Mark Janssen Date: Mon, 20 May 2019 14:36:28 +0200 Subject: [PATCH] Fix golint failures of pkg/kubelet/qos --- hack/.golint_failures | 1 - pkg/kubelet/qos/doc.go | 2 +- pkg/kubelet/qos/policy.go | 11 +++++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/hack/.golint_failures b/hack/.golint_failures index 2d9dbd53c6a..8c91632e7cb 100644 --- a/hack/.golint_failures +++ b/hack/.golint_failures @@ -133,7 +133,6 @@ pkg/kubelet/metrics pkg/kubelet/pluginmanager/pluginwatcher pkg/kubelet/pod/testing pkg/kubelet/preemption -pkg/kubelet/qos pkg/kubelet/remote pkg/kubelet/stats pkg/kubelet/status diff --git a/pkg/kubelet/qos/doc.go b/pkg/kubelet/qos/doc.go index 46c271afc80..6210ed45e48 100644 --- a/pkg/kubelet/qos/doc.go +++ b/pkg/kubelet/qos/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// package qos contains helper functions for quality of service. +// Package qos contains helper functions for quality of service. // For each resource (memory, CPU) Kubelet supports three classes of containers. // Memory guaranteed containers will receive the highest priority and will get all the resources // they need. diff --git a/pkg/kubelet/qos/policy.go b/pkg/kubelet/qos/policy.go index 344b0d99ce9..b1e8ed998bc 100644 --- a/pkg/kubelet/qos/policy.go +++ b/pkg/kubelet/qos/policy.go @@ -27,15 +27,18 @@ const ( // 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 + PodInfraOOMAdj int = -998 + // KubeletOOMScoreAdj is the OOM score adjustment for Kubelet + KubeletOOMScoreAdj int = -999 + // DockerOOMScoreAdj is the OOM score adjustment for Docker + DockerOOMScoreAdj int = -999 + // KubeProxyOOMScoreAdj is the OOM score adjustment for kube-proxy KubeProxyOOMScoreAdj int = -999 guaranteedOOMScoreAdj int = -998 besteffortOOMScoreAdj int = 1000 ) -// GetContainerOOMAdjust returns the amount by which the OOM score of all processes in the +// GetContainerOOMScoreAdjust returns the amount by which the OOM score of all processes in the // container should be adjusted. // The OOM score of a process is the percentage of memory it consumes // multiplied by 10 (barring exceptional cases) + a configurable quantity which is between -1000