From d8aa0ca82a33b5d42119875b6286cd56f74808ee Mon Sep 17 00:00:00 2001 From: wackxu Date: Tue, 19 Sep 2017 11:15:10 +0800 Subject: [PATCH] fix the bad code comment and make the format unify --- pkg/kubelet/cm/container_manager.go | 10 +++++----- pkg/kubelet/cm/node_container_manager.go | 6 +++--- pkg/kubelet/eviction/helpers.go | 2 +- pkg/kubelet/eviction/types.go | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pkg/kubelet/cm/container_manager.go b/pkg/kubelet/cm/container_manager.go index 36039bdbc0..eb556ef001 100644 --- a/pkg/kubelet/cm/container_manager.go +++ b/pkg/kubelet/cm/container_manager.go @@ -42,14 +42,14 @@ type ContainerManager interface { // - Creates the system container where all non-containerized processes run. Start(*v1.Node, ActivePodsFunc, status.PodStatusProvider, internalapi.RuntimeService) error - // Returns resources allocated to system cgroups in the machine. + // SystemCgroupsLimit returns resources allocated to system cgroups in the machine. // These cgroups include the system and Kubernetes services. SystemCgroupsLimit() v1.ResourceList - // Returns a NodeConfig that is being used by the container manager. + // GetNodeConfig returns a NodeConfig that is being used by the container manager. GetNodeConfig() NodeConfig - // Returns internal Status. + // Status returns internal Status. Status() Status // NewPodContainerManager is a factory method which returns a podContainerManager object @@ -62,7 +62,7 @@ type ContainerManager interface { // GetQOSContainersInfo returns the names of top level QoS containers GetQOSContainersInfo() QOSContainersInfo - // GetNodeAllocatable returns the amount of compute resources that have to be reserved from scheduling. + // GetNodeAllocatableReservation returns the amount of compute resources that have to be reserved from scheduling. GetNodeAllocatableReservation() v1.ResourceList // GetCapacity returns the amount of compute resources tracked by container manager available on the node. @@ -72,7 +72,7 @@ type ContainerManager interface { // level QoS containers have their desired state in a thread-safe way UpdateQOSCgroups() error - // Returns RunContainerOptions with devices, mounts, and env fields populated for + // GetResources returns RunContainerOptions with devices, mounts, and env fields populated for // extended resources required by container. GetResources(pod *v1.Pod, container *v1.Container, activePods []*v1.Pod) (*kubecontainer.RunContainerOptions, error) diff --git a/pkg/kubelet/cm/node_container_manager.go b/pkg/kubelet/cm/node_container_manager.go index c9cb48ce55..f587eaa4f2 100644 --- a/pkg/kubelet/cm/node_container_manager.go +++ b/pkg/kubelet/cm/node_container_manager.go @@ -55,7 +55,7 @@ func (cm *containerManagerImpl) createNodeAllocatableCgroups() error { return nil } -// Enforce Node Allocatable Cgroup settings. +// enforceNodeAllocatableCgroups enforce Node Allocatable Cgroup settings. func (cm *containerManagerImpl) enforceNodeAllocatableCgroups() error { nc := cm.NodeConfig.NodeAllocatableConfig @@ -139,7 +139,7 @@ func enforceExistingCgroup(cgroupManager CgroupManager, cName string, rl v1.Reso return nil } -// Returns a ResourceConfig object that can be used to create or update cgroups via CgroupManager interface. +// getCgroupConfig returns a ResourceConfig object that can be used to create or update cgroups via CgroupManager interface. func getCgroupConfig(rl v1.ResourceList) *ResourceConfig { // TODO(vishh): Set CPU Quota if necessary. if rl == nil { @@ -186,7 +186,7 @@ func (cm *containerManagerImpl) getNodeAllocatableAbsolute() v1.ResourceList { } -// GetNodeAllocatable returns amount of compute or storage resource that have to be reserved on this node from scheduling. +// GetNodeAllocatableReservation returns amount of compute or storage resource that have to be reserved on this node from scheduling. func (cm *containerManagerImpl) GetNodeAllocatableReservation() v1.ResourceList { evictionReservation := hardEvictionReservation(cm.HardEvictionThresholds, cm.capacity) result := make(v1.ResourceList) diff --git a/pkg/kubelet/eviction/helpers.go b/pkg/kubelet/eviction/helpers.go index dd04e9ff62..4e09d72524 100644 --- a/pkg/kubelet/eviction/helpers.go +++ b/pkg/kubelet/eviction/helpers.go @@ -483,7 +483,7 @@ func localEphemeralVolumeNames(pod *v1.Pod) []string { return result } -// podLocalEphemeralStorageUsage aggregates pod local ephemeral storage usage and inode consumption for the specified stats to measure. +// podLocalEphemeralStorageUsage aggregates pod local ephemeral storage usage and inode consumption for the specified stats to measure. func podLocalEphemeralStorageUsage(podStats statsapi.PodStats, pod *v1.Pod, statsToMeasure []fsStatsType) (v1.ResourceList, error) { disk := resource.Quantity{Format: resource.BinarySI} inodes := resource.Quantity{Format: resource.BinarySI} diff --git a/pkg/kubelet/eviction/types.go b/pkg/kubelet/eviction/types.go index 7b97f37b06..f9548510c8 100644 --- a/pkg/kubelet/eviction/types.go +++ b/pkg/kubelet/eviction/types.go @@ -72,7 +72,7 @@ type DiskInfoProvider interface { type CapacityProvider interface { // GetCapacity returns the amount of compute resources tracked by container manager available on the node. GetCapacity() v1.ResourceList - // GetNodeAllocatable returns the amount of compute resources that have to be reserved from scheduling. + // GetNodeAllocatableReservation returns the amount of compute resources that have to be reserved from scheduling. GetNodeAllocatableReservation() v1.ResourceList }