Skip to content

Commit d8fa0b1

Browse files
committed
fix: some changes bug like
1 parent ce50d3c commit d8fa0b1

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

internal/controller/qworker_controller.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ func (r *QWorkerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct
5959
return ctrl.Result{}, err
6060
}
6161
currentPodCount := len(podList.Items)
62-
qworker.Status.CurrentReplicas = currentPodCount
6362

63+
qworker.Status.CurrentReplicas = currentPodCount
6464
if err := r.Status().Update(ctx, qworker); err != nil {
6565
log.Log.Error(err, fmt.Sprintf("Failed to update QWorker status %s", qworker.Name))
6666
return ctrl.Result{}, err
@@ -83,8 +83,10 @@ func (r *QWorkerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct
8383
desiredPodsAmount := min(
8484
max(QueueLength*qworker.Spec.ScaleConfig.ScalingFactor, qworker.Spec.ScaleConfig.MinReplicas),
8585
qworker.Spec.ScaleConfig.MaxReplicas)
86-
log.Log.Info(fmt.Sprintf("desired amount: %d", desiredPodsAmount))
86+
8787
qworker.Status.DesiredReplicas = desiredPodsAmount
88+
log.Log.Info(fmt.Sprintf("desired amount: %d", qworker.Status.DesiredReplicas))
89+
log.Log.Info(fmt.Sprintf("current amount: %d", qworker.Status.CurrentReplicas))
8890

8991
diffAmount := qworker.Status.DesiredReplicas - qworker.Status.CurrentReplicas
9092
log.Log.Info(fmt.Sprintf("going to deploy / takedown: %d pods", diffAmount))

internal/controller/scalerconfig_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func (r *ScalerConfigReconciler) reconcileScaler(ctx context.Context, req ctrl.R
100100
return ctrl.Result{}, nil
101101
}
102102
log.Log.Error(err, fmt.Sprintf("unable to fetch ScalerConfig %s", req.NamespacedName))
103-
return ctrl.Result{Requeue: true}, err
103+
return ctrl.Result{}, err
104104
}
105105

106106
if err := r.fetchSecretsFromReferences(ctx, scalerConfig); err != nil {

0 commit comments

Comments
 (0)