diff --git a/go.mod b/go.mod index 3131c4078..6148fa09b 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,7 @@ go 1.19 require ( github.com/client9/misspell v0.3.4 + github.com/google/go-cmp v0.5.6 github.com/spf13/cobra v1.4.0 github.com/spf13/pflag v1.0.5 k8s.io/api v0.25.0 @@ -51,7 +52,6 @@ require ( github.com/golang/protobuf v1.5.2 // indirect github.com/gomarkdown/markdown v0.0.0-20200824053859-8c8b3816f167 // indirect github.com/google/gnostic v0.5.7-v3refs // indirect - github.com/google/go-cmp v0.5.6 // indirect github.com/google/gofuzz v1.1.0 // indirect github.com/google/uuid v1.1.2 // indirect github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect diff --git a/pkg/framework/plugins/defaultevictor/defaults.go b/pkg/framework/plugins/defaultevictor/defaults.go index e1c26e708..f71731c45 100644 --- a/pkg/framework/plugins/defaultevictor/defaults.go +++ b/pkg/framework/plugins/defaultevictor/defaults.go @@ -27,16 +27,16 @@ func SetDefaults_DefaultEvictorArgs(obj *DefaultEvictorArgs) { if obj.NodeSelector == "" { obj.NodeSelector = "" } - if obj.EvictLocalStoragePods == false { + if !obj.EvictLocalStoragePods { obj.EvictSystemCriticalPods = false } - if obj.EvictSystemCriticalPods == false { + if !obj.EvictSystemCriticalPods { obj.EvictSystemCriticalPods = false } - if obj.IgnorePvcPods == false { + if !obj.IgnorePvcPods { obj.IgnorePvcPods = false } - if obj.EvictFailedBarePods == false { + if !obj.EvictFailedBarePods { obj.EvictFailedBarePods = false } if obj.LabelSelector == nil { @@ -45,7 +45,7 @@ func SetDefaults_DefaultEvictorArgs(obj *DefaultEvictorArgs) { if obj.PriorityThreshold == nil { obj.PriorityThreshold = nil } - if obj.NodeFit == false { + if !obj.NodeFit { obj.NodeFit = false } } diff --git a/pkg/framework/plugins/nodeutilization/defaults.go b/pkg/framework/plugins/nodeutilization/defaults.go index 843033804..6621a1863 100644 --- a/pkg/framework/plugins/nodeutilization/defaults.go +++ b/pkg/framework/plugins/nodeutilization/defaults.go @@ -24,7 +24,7 @@ func addDefaultingFuncs(scheme *runtime.Scheme) error { // SetDefaults_LowNodeUtilizationArgs // TODO: the final default values would be discussed in community func SetDefaults_LowNodeUtilizationArgs(obj *LowNodeUtilizationArgs) { - if obj.UseDeviationThresholds == false { + if !obj.UseDeviationThresholds { obj.UseDeviationThresholds = false } if obj.Thresholds == nil { diff --git a/pkg/framework/plugins/removefailedpods/defaults.go b/pkg/framework/plugins/removefailedpods/defaults.go index 9b40255b8..52f95e1c6 100644 --- a/pkg/framework/plugins/removefailedpods/defaults.go +++ b/pkg/framework/plugins/removefailedpods/defaults.go @@ -39,7 +39,7 @@ func SetDefaults_RemoveFailedPodsArgs(obj *RemoveFailedPodsArgs) { if obj.Reasons == nil { obj.Reasons = nil } - if obj.IncludingInitContainers == false { + if !obj.IncludingInitContainers { obj.IncludingInitContainers = false } } diff --git a/pkg/framework/plugins/removepodshavingtoomanyrestarts/defaults.go b/pkg/framework/plugins/removepodshavingtoomanyrestarts/defaults.go index 388232b0a..e62af8e72 100644 --- a/pkg/framework/plugins/removepodshavingtoomanyrestarts/defaults.go +++ b/pkg/framework/plugins/removepodshavingtoomanyrestarts/defaults.go @@ -33,7 +33,7 @@ func SetDefaults_RemovePodsHavingTooManyRestartsArgs(obj *RemovePodsHavingTooMan if obj.PodRestartThreshold == 0 { obj.PodRestartThreshold = 0 } - if obj.IncludingInitContainers == false { + if !obj.IncludingInitContainers { obj.IncludingInitContainers = false } } diff --git a/pkg/framework/plugins/removepodsviolatingnodetaints/defaults.go b/pkg/framework/plugins/removepodsviolatingnodetaints/defaults.go index 7158b1234..12eebb91b 100644 --- a/pkg/framework/plugins/removepodsviolatingnodetaints/defaults.go +++ b/pkg/framework/plugins/removepodsviolatingnodetaints/defaults.go @@ -30,7 +30,7 @@ func SetDefaults_RemovePodsViolatingNodeTaintsArgs(obj *RemovePodsViolatingNodeT if obj.LabelSelector == nil { obj.LabelSelector = nil } - if obj.IncludePreferNoSchedule == false { + if !obj.IncludePreferNoSchedule { obj.IncludePreferNoSchedule = false } if obj.ExcludedTaints == nil { diff --git a/pkg/framework/plugins/removepodsviolatingtopologyspreadconstraint/defaults.go b/pkg/framework/plugins/removepodsviolatingtopologyspreadconstraint/defaults.go index e364a07e7..6d62ee684 100644 --- a/pkg/framework/plugins/removepodsviolatingtopologyspreadconstraint/defaults.go +++ b/pkg/framework/plugins/removepodsviolatingtopologyspreadconstraint/defaults.go @@ -30,7 +30,7 @@ func SetDefaults_RemovePodsViolatingTopologySpreadConstraintArgs(obj *RemovePods if obj.LabelSelector == nil { obj.LabelSelector = nil } - if obj.IncludeSoftConstraints == false { + if !obj.IncludeSoftConstraints { obj.IncludeSoftConstraints = false } }