From 5826cae547114da5e7b1489147694aceaae7f999 Mon Sep 17 00:00:00 2001 From: xiaomudk Date: Fri, 10 Jun 2022 00:09:50 +0800 Subject: [PATCH] clean: remove useless parentheses --- .../plugins/defaultpreemption/default_preemption.go | 6 ++---- pkg/scheduler/framework/plugins/interpodaffinity/plugin.go | 6 ++---- .../plugins/noderesources/requested_to_capacity_ratio.go | 4 +--- pkg/scheduler/framework/plugins/podtopologyspread/plugin.go | 6 ++---- pkg/scheduler/framework/types.go | 6 ++---- 5 files changed, 9 insertions(+), 19 deletions(-) diff --git a/pkg/scheduler/framework/plugins/defaultpreemption/default_preemption.go b/pkg/scheduler/framework/plugins/defaultpreemption/default_preemption.go index ae3f16b0daf..91fc9ef9ed0 100644 --- a/pkg/scheduler/framework/plugins/defaultpreemption/default_preemption.go +++ b/pkg/scheduler/framework/plugins/defaultpreemption/default_preemption.go @@ -43,10 +43,8 @@ import ( "k8s.io/kubernetes/pkg/scheduler/util" ) -const ( - // Name of the plugin used in the plugin registry and configurations. - Name = names.DefaultPreemption -) +// Name of the plugin used in the plugin registry and configurations. +const Name = names.DefaultPreemption // DefaultPreemption is a PostFilter plugin implements the preemption logic. type DefaultPreemption struct { diff --git a/pkg/scheduler/framework/plugins/interpodaffinity/plugin.go b/pkg/scheduler/framework/plugins/interpodaffinity/plugin.go index 4b786e0b790..f7e84ce09d9 100644 --- a/pkg/scheduler/framework/plugins/interpodaffinity/plugin.go +++ b/pkg/scheduler/framework/plugins/interpodaffinity/plugin.go @@ -30,10 +30,8 @@ import ( "k8s.io/kubernetes/pkg/scheduler/framework/plugins/names" ) -const ( - // Name is the name of the plugin used in the plugin registry and configurations. - Name = names.InterPodAffinity -) +// Name is the name of the plugin used in the plugin registry and configurations. +const Name = names.InterPodAffinity var _ framework.PreFilterPlugin = &InterPodAffinity{} var _ framework.FilterPlugin = &InterPodAffinity{} diff --git a/pkg/scheduler/framework/plugins/noderesources/requested_to_capacity_ratio.go b/pkg/scheduler/framework/plugins/noderesources/requested_to_capacity_ratio.go index 678aef52e69..36cd9f1e623 100644 --- a/pkg/scheduler/framework/plugins/noderesources/requested_to_capacity_ratio.go +++ b/pkg/scheduler/framework/plugins/noderesources/requested_to_capacity_ratio.go @@ -24,9 +24,7 @@ import ( "k8s.io/kubernetes/pkg/scheduler/framework/plugins/helper" ) -const ( - maxUtilization = 100 -) +const maxUtilization = 100 // buildRequestedToCapacityRatioScorerFunction allows users to apply bin packing // on core resources like CPU, Memory as well as extended resources like accelerators. diff --git a/pkg/scheduler/framework/plugins/podtopologyspread/plugin.go b/pkg/scheduler/framework/plugins/podtopologyspread/plugin.go index a5d17ca5cea..4ca762ca4c8 100644 --- a/pkg/scheduler/framework/plugins/podtopologyspread/plugin.go +++ b/pkg/scheduler/framework/plugins/podtopologyspread/plugin.go @@ -72,10 +72,8 @@ var _ framework.PreScorePlugin = &PodTopologySpread{} var _ framework.ScorePlugin = &PodTopologySpread{} var _ framework.EnqueueExtensions = &PodTopologySpread{} -const ( - // Name is the name of the plugin used in the plugin registry and configurations. - Name = names.PodTopologySpread -) +// Name is the name of the plugin used in the plugin registry and configurations. +const Name = names.PodTopologySpread // Name returns name of the plugin. It is used in logs, etc. func (pl *PodTopologySpread) Name() string { diff --git a/pkg/scheduler/framework/types.go b/pkg/scheduler/framework/types.go index 2fa8072031b..93970327d5a 100644 --- a/pkg/scheduler/framework/types.go +++ b/pkg/scheduler/framework/types.go @@ -226,10 +226,8 @@ type FitError struct { Diagnosis Diagnosis } -const ( - // NoNodeAvailableMsg is used to format message when no nodes available. - NoNodeAvailableMsg = "0/%v nodes are available" -) +// NoNodeAvailableMsg is used to format message when no nodes available. +const NoNodeAvailableMsg = "0/%v nodes are available" // Error returns detailed information of why the pod failed to fit on each node func (f *FitError) Error() string {