From 376767c57780e0e11cc833f85a7c4ba14550b823 Mon Sep 17 00:00:00 2001 From: googs1025 Date: Mon, 8 Apr 2024 14:28:54 +0800 Subject: [PATCH] fix fmt errorf and typo --- vertical-pod-autoscaler/pkg/recommender/model/cluster.go | 4 ++-- vertical-pod-autoscaler/pkg/recommender/model/vpa.go | 2 +- .../pkg/recommender/routines/recommender.go | 2 +- vertical-pod-autoscaler/pkg/recommender/util/histogram.go | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/vertical-pod-autoscaler/pkg/recommender/model/cluster.go b/vertical-pod-autoscaler/pkg/recommender/model/cluster.go index 2e6f1bd2017a..be3c61d39451 100644 --- a/vertical-pod-autoscaler/pkg/recommender/model/cluster.go +++ b/vertical-pod-autoscaler/pkg/recommender/model/cluster.go @@ -385,7 +385,7 @@ func (cluster *ClusterState) garbageCollectAggregateCollectionStates(now time.Ti } // RateLimitedGarbageCollectAggregateCollectionStates removes obsolete AggregateCollectionStates from the ClusterState. -// It performs clean up only if more than `gcInterval` passed since the last time it performed a clean up. +// It performs clean up only if more than `gcInterval` passed since the last time it performed a cleanup. // AggregateCollectionState is obsolete in following situations: // 1) It has no samples and there are no more contributive pods - a pod is contributive in any of following situations: // @@ -491,7 +491,7 @@ type aggregateStateKey struct { labelSetMap *labelSetMap } -// Labels returns the namespace for the aggregateStateKey. +// Namespace returns the namespace for the aggregateStateKey. func (k aggregateStateKey) Namespace() string { return k.namespace } diff --git a/vertical-pod-autoscaler/pkg/recommender/model/vpa.go b/vertical-pod-autoscaler/pkg/recommender/model/vpa.go index 4a97c4c5ba2b..b4f32e07f8c1 100644 --- a/vertical-pod-autoscaler/pkg/recommender/model/vpa.go +++ b/vertical-pod-autoscaler/pkg/recommender/model/vpa.go @@ -282,7 +282,7 @@ func (vpa *Vpa) AsStatus() *vpa_types.VerticalPodAutoscalerStatus { return status } -// HasMatchedPods returns true if there are are currently active pods in the +// HasMatchedPods returns true if there are currently active pods in the // cluster matching this VPA, based on conditions. UpdateConditions should be // called first. func (vpa *Vpa) HasMatchedPods() bool { diff --git a/vertical-pod-autoscaler/pkg/recommender/routines/recommender.go b/vertical-pod-autoscaler/pkg/recommender/routines/recommender.go index 5d7ec8ade709..5dc5d1df0d90 100644 --- a/vertical-pod-autoscaler/pkg/recommender/routines/recommender.go +++ b/vertical-pod-autoscaler/pkg/recommender/routines/recommender.go @@ -76,7 +76,7 @@ func (r *recommender) GetClusterStateFeeder() input.ClusterStateFeeder { return r.clusterStateFeeder } -// Updates VPA CRD objects' statuses. +// UpdateVPAs update VPA CRD objects' status. func (r *recommender) UpdateVPAs() { cnt := metrics_recommender.NewObjectCounter() defer cnt.Observe() diff --git a/vertical-pod-autoscaler/pkg/recommender/util/histogram.go b/vertical-pod-autoscaler/pkg/recommender/util/histogram.go index 016a3d659bb1..cd0d360d0f4b 100644 --- a/vertical-pod-autoscaler/pkg/recommender/util/histogram.go +++ b/vertical-pod-autoscaler/pkg/recommender/util/histogram.go @@ -248,10 +248,10 @@ func (h *histogram) SaveToChekpoint() (*vpa_types.HistogramCheckpoint, error) { func (h *histogram) LoadFromCheckpoint(checkpoint *vpa_types.HistogramCheckpoint) error { if checkpoint == nil { - return fmt.Errorf("Cannot load from empty checkpoint") + return fmt.Errorf("cannot load from empty checkpoint") } if checkpoint.TotalWeight < 0.0 { - return fmt.Errorf("Cannot load checkpoint with negative weight %v", checkpoint.TotalWeight) + return fmt.Errorf("cannot load checkpoint with negative weight %v", checkpoint.TotalWeight) } sum := int64(0) for bucket, weight := range checkpoint.BucketWeights {