From 32aaea1baf0dabd4053e8bea657f37be4f67adf8 Mon Sep 17 00:00:00 2001 From: danielqsj Date: Wed, 6 Nov 2019 22:58:55 +0800 Subject: [PATCH] fix golint error --- test/e2e/framework/autoscaling/autoscaling_utils.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/e2e/framework/autoscaling/autoscaling_utils.go b/test/e2e/framework/autoscaling/autoscaling_utils.go index 5241b4aad0c..3434c014d2c 100644 --- a/test/e2e/framework/autoscaling/autoscaling_utils.go +++ b/test/e2e/framework/autoscaling/autoscaling_utils.go @@ -104,6 +104,7 @@ type ResourceConsumer struct { requestSizeCustomMetric int } +// GetResourceConsumerImage is a wrapper to get the fully qualified URI of the ResourceConsumer image func GetResourceConsumerImage() string { return resourceConsumerImage } @@ -185,7 +186,7 @@ func (rc *ResourceConsumer) ConsumeMem(megabytes int) { rc.mem <- megabytes } -// ConsumeMem consumes given number of custom metric +// ConsumeCustomMetric consumes given number of custom metric func (rc *ResourceConsumer) ConsumeCustomMetric(amount int) { framework.Logf("RC %s: consume custom metric %v in total", rc.name, amount) rc.customMetric <- amount @@ -364,11 +365,12 @@ func (rc *ResourceConsumer) GetReplicas() int { return 0 } -// GetReplicas get the corresponding horizontalPodAutoscaler object +// GetHpa get the corresponding horizontalPodAutoscaler object func (rc *ResourceConsumer) GetHpa(name string) (*autoscalingv1.HorizontalPodAutoscaler, error) { return rc.clientSet.AutoscalingV1().HorizontalPodAutoscalers(rc.nsName).Get(name, metav1.GetOptions{}) } +// WaitForReplicas wait for the desired replicas func (rc *ResourceConsumer) WaitForReplicas(desiredReplicas int, duration time.Duration) { interval := 20 * time.Second err := wait.PollImmediate(interval, duration, func() (bool, error) {