From abcf8bb57863fb34fb4337c93dfcee1993da39a7 Mon Sep 17 00:00:00 2001 From: Noah Kantrowitz Date: Tue, 5 Jan 2021 12:26:20 -0800 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Zbynek Roubalik <726523+zroubalik@users.noreply.github.com> Signed-off-by: Noah Kantrowitz --- pkg/scaling/executor/scale_scaledobjects.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/scaling/executor/scale_scaledobjects.go b/pkg/scaling/executor/scale_scaledobjects.go index 702bd241064..8bc4c2e0ea0 100644 --- a/pkg/scaling/executor/scale_scaledobjects.go +++ b/pkg/scaling/executor/scale_scaledobjects.go @@ -18,7 +18,7 @@ func (e *scaleExecutor) RequestScale(ctx context.Context, scaledObject *kedav1al "scaledObject.Namespace", scaledObject.Namespace, "scaleTarget.Name", scaledObject.Spec.ScaleTargetRef.Name) - // Get the current replica count. As a special case, Deployments fetch directly from the object so they can use the informer cache + // Get the current replica count. As a special case, Deployments and StatefulSets fetch directly from the object so they can use the informer cache // to reduce API calls. Everything else uses the scale subresource. var currentScale *autoscalingv1.Scale var currentReplicas int32 @@ -28,7 +28,7 @@ func (e *scaleExecutor) RequestScale(ctx context.Context, scaledObject *kedav1al deployment := &appsv1.Deployment{} err := e.client.Get(ctx, client.ObjectKey{Name: targetGVKR.Resource, Namespace: scaledObject.Namespace}, deployment) if err != nil { - logger.Error(err, "Error getting information on the current Scale (ie. replias count) on the scaleTarget") + logger.Error(err, "Error getting information on the current Scale (ie. replicas count) on the scaleTarget") return } currentReplicas = *deployment.Spec.Replicas @@ -36,7 +36,7 @@ func (e *scaleExecutor) RequestScale(ctx context.Context, scaledObject *kedav1al statefulSet := &appsv1.StatefulSet{} err := e.client.Get(ctx, client.ObjectKey{Name: targetGVKR.Resource, Namespace: scaledObject.Namespace}, statefulSet) if err != nil { - logger.Error(err, "Error getting information on the current Scale (ie. replias count) on the scaleTarget") + logger.Error(err, "Error getting information on the current Scale (ie. replicas count) on the scaleTarget") return } currentReplicas = *statefulSet.Spec.Replicas @@ -44,7 +44,7 @@ func (e *scaleExecutor) RequestScale(ctx context.Context, scaledObject *kedav1al var err error currentScale, err = e.getScaleTargetScale(ctx, scaledObject) if err != nil { - logger.Error(err, "Error getting information on the current Scale (ie. replias count) on the scaleTarget") + logger.Error(err, "Error getting information on the current Scale (ie. replicas count) on the scaleTarget") return } currentReplicas = currentScale.Spec.Replicas