From a702be8e635db6bc1bcf93315611abbb7935fd67 Mon Sep 17 00:00:00 2001 From: "Yuki Sonoda (Yugui)" Date: Wed, 16 Jul 2014 18:46:22 +0900 Subject: [PATCH] Fixes new golint errors in pkg/kubelet after merge --- pkg/kubelet/kubelet.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/kubelet/kubelet.go b/pkg/kubelet/kubelet.go index 9561537666b..6e5bb93f328 100644 --- a/pkg/kubelet/kubelet.go +++ b/pkg/kubelet/kubelet.go @@ -48,8 +48,8 @@ const defaultChanSize = 1024 // taken from lmctfy https://github.com/google/lmctfy/blob/master/lmctfy/controllers/cpu_controller.cc const minShares = 2 -const sharesPerCpu = 1024 -const milliCpuToCpu = 1000 +const sharesPerCPU = 1024 +const milliCPUToCPU = 1000 // CadvisorInterface is an abstract interface for testability. It abstracts the interface of "github.com/google/cadvisor/client".Client. type CadvisorInterface interface { @@ -274,9 +274,9 @@ func makePortsAndBindings(container *api.Container) (map[docker.Port]struct{}, m return exposedPorts, portBindings } -func milliCpuToShares(milliCpu int) int { - // Conceptually (milliCpu / milliCpuToCpu) * sharesPerCpu, but factored to improve rounding. - shares := (milliCpu * sharesPerCpu) / milliCpuToCpu +func milliCPUToShares(milliCPU int) int { + // Conceptually (milliCPU / milliCPUToCPU) * sharesPerCPU, but factored to improve rounding. + shares := (milliCPU * sharesPerCPU) / milliCPUToCPU if shares < minShares { return minShares } @@ -298,7 +298,7 @@ func (kl *Kubelet) runContainer(manifest *api.ContainerManifest, container *api. Hostname: container.Name, Image: container.Image, Memory: int64(container.Memory), - CpuShares: int64(milliCpuToShares(container.CPU)), + CpuShares: int64(milliCPUToShares(container.CPU)), Volumes: volumes, WorkingDir: container.WorkingDir, }, @@ -864,7 +864,7 @@ func (kl *Kubelet) statsFromContainerPath(containerPath string, req *info.Contai return cinfo, nil } -// GetContainerStats returns stats (from Cadvisor) for a container. +// GetContainerInfo returns stats (from Cadvisor) for a container. func (kl *Kubelet) GetContainerInfo(podID, containerName string, req *info.ContainerInfoRequest) (*info.ContainerInfo, error) { if kl.CadvisorClient == nil { return nil, nil