From 922e6db974632b5de55762689648306d5bf7ffb8 Mon Sep 17 00:00:00 2001 From: whitebear009 Date: Tue, 14 Jun 2022 16:54:26 +0800 Subject: [PATCH] fix log with ehpa specificReplicas --- pkg/controller/ehpa/effective_hpa_controller.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/controller/ehpa/effective_hpa_controller.go b/pkg/controller/ehpa/effective_hpa_controller.go index 3b6f3b566..abb1f685f 100644 --- a/pkg/controller/ehpa/effective_hpa_controller.go +++ b/pkg/controller/ehpa/effective_hpa_controller.go @@ -130,14 +130,14 @@ func (c *EffectiveHPAController) Reconcile(ctx context.Context, req ctrl.Request updatedScale, err := c.ScaleClient.Scales(scale.Namespace).Update(ctx, mapping.Resource.GroupResource(), scale, metav1.UpdateOptions{}) if err != nil { c.Recorder.Event(ehpa, v1.EventTypeNormal, "FailedManualScale", err.Error()) - msg := fmt.Sprintf("Failed to manual scale target to specific replicas, ehpa %s replicas %d", klog.KObj(ehpa), ehpa.Spec.SpecificReplicas) + msg := fmt.Sprintf("Failed to manual scale target to specific replicas, ehpa %s replicas %d", klog.KObj(ehpa), *ehpa.Spec.SpecificReplicas) klog.Error(err, msg) setCondition(newStatus, autoscalingapi.Ready, metav1.ConditionFalse, "FailedScale", msg) c.UpdateStatus(ctx, ehpa, newStatus) return ctrl.Result{}, err } - klog.Infof("Manual scale target to specific replicas, ehpa %s replicas %d", klog.KObj(ehpa), ehpa.Spec.SpecificReplicas) + klog.Infof("Manual scale target to specific replicas, ehpa %s replicas %d", klog.KObj(ehpa), *ehpa.Spec.SpecificReplicas) now := metav1.Now() newStatus.LastScaleTime = &now newStatus.CurrentReplicas = &updatedScale.Status.Replicas