Skip to content

Commit

Permalink
fix log with ehpa specificReplicas
Browse files Browse the repository at this point in the history
  • Loading branch information
whitebear009 committed Jun 14, 2022
1 parent 7248c22 commit 922e6db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/controller/ehpa/effective_hpa_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 922e6db

Please sign in to comment.