From ca24afe7788f0712b553594de719afecd5333318 Mon Sep 17 00:00:00 2001 From: Christoph Blecker Date: Tue, 7 Mar 2017 18:32:45 -0800 Subject: [PATCH] Additional plugin/pkg/scheduler golint fixes --- hack/.linted_packages | 2 ++ plugin/pkg/scheduler/algorithm/types.go | 2 +- .../algorithmprovider/defaults/defaults.go | 15 ++++++++++----- plugin/pkg/scheduler/algorithmprovider/plugins.go | 2 +- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/hack/.linted_packages b/hack/.linted_packages index ff447d66dad..01d43460ee7 100644 --- a/hack/.linted_packages +++ b/hack/.linted_packages @@ -287,6 +287,8 @@ plugin/pkg/auth/authenticator/token/bootstrap plugin/pkg/auth/authorizer plugin/pkg/auth/authorizer/rbac/bootstrappolicy plugin/pkg/scheduler +plugin/pkg/scheduler/algorithmprovider +plugin/pkg/scheduler/algorithmprovider/defaults plugin/pkg/scheduler/api/validation staging/src/k8s.io/apimachinery/pkg/api/equality staging/src/k8s.io/apimachinery/pkg/api/errors diff --git a/plugin/pkg/scheduler/algorithm/types.go b/plugin/pkg/scheduler/algorithm/types.go index 78f426ff2d3..580722c0785 100644 --- a/plugin/pkg/scheduler/algorithm/types.go +++ b/plugin/pkg/scheduler/algorithm/types.go @@ -41,7 +41,7 @@ type PriorityMapFunction func(pod *v1.Pod, meta interface{}, nodeInfo *scheduler // TODO: Change interface{} to a specific type. type PriorityReduceFunction func(pod *v1.Pod, meta interface{}, nodeNameToInfo map[string]*schedulercache.NodeInfo, result schedulerapi.HostPriorityList) error -// MetdataProducer is a function that computes metadata for a given pod. +// MetadataProducer is a function that computes metadata for a given pod. type MetadataProducer func(pod *v1.Pod, nodeNameToInfo map[string]*schedulercache.NodeInfo) interface{} // DEPRECATED diff --git a/plugin/pkg/scheduler/algorithmprovider/defaults/defaults.go b/plugin/pkg/scheduler/algorithmprovider/defaults/defaults.go index ded15fe9776..6b1f6550936 100644 --- a/plugin/pkg/scheduler/algorithmprovider/defaults/defaults.go +++ b/plugin/pkg/scheduler/algorithmprovider/defaults/defaults.go @@ -14,7 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This is the default algorithm provider for the scheduler. package defaults import ( @@ -35,13 +34,19 @@ import ( ) const ( + // DefaultMaxGCEPDVolumes defines the maximum number of PD Volumes for GCE // GCE instances can have up to 16 PD volumes attached. DefaultMaxGCEPDVolumes = 16 - // Larger Azure VMs can actually have much more disks attached. TODO We should determine the max based on VM size + // DefaultMaxAzureDiskVolumes defines the maximum number of PD Volumes for Azure + // Larger Azure VMs can actually have much more disks attached. + // TODO We should determine the max based on VM size DefaultMaxAzureDiskVolumes = 16 - ClusterAutoscalerProvider = "ClusterAutoscalerProvider" - StatefulSetKind = "StatefulSet" - KubeMaxPDVols = "KUBE_MAX_PD_VOLS" + // ClusterAutoscalerProvider defines the default autoscaler provider + ClusterAutoscalerProvider = "ClusterAutoscalerProvider" + // StatefulSetKind defines the name of 'StatefulSet' kind + StatefulSetKind = "StatefulSet" + // KubeMaxPDVols defines the maximum number of PD Volumes per kubelet + KubeMaxPDVols = "KUBE_MAX_PD_VOLS" ) func init() { diff --git a/plugin/pkg/scheduler/algorithmprovider/plugins.go b/plugin/pkg/scheduler/algorithmprovider/plugins.go index f85cf055536..2aace84d046 100644 --- a/plugin/pkg/scheduler/algorithmprovider/plugins.go +++ b/plugin/pkg/scheduler/algorithmprovider/plugins.go @@ -14,9 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package is used to register algorithm provider plugins. package algorithmprovider import ( + // Import defaults of algorithmprovider for initialization. _ "k8s.io/kubernetes/plugin/pkg/scheduler/algorithmprovider/defaults" )