Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
randytqwjp committed Dec 13, 2024
1 parent 2e261c4 commit 7c0e997
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/controller/tortoise_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ func (r *TortoiseReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_
}
scalingActive, err := r.HpaService.CheckHpaMetricStatus(ctx, hpa)
if err != nil {
if tortoise.Status.TortoisePhase == autoscalingv1beta3.TortoisePhaseWorking && hpaCreated == false {
if tortoise.Status.TortoisePhase == autoscalingv1beta3.TortoisePhaseWorking && !hpaCreated {
logger.Error(err, "HPA status abnormal", "tortoise", req.NamespacedName)
return ctrl.Result{}, err
}
Expand Down
5 changes: 4 additions & 1 deletion pkg/tortoise/tortoise_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4706,7 +4706,10 @@ func TestService_UpdateTortoisePhaseIfHPAIsUnhealthy(t *testing.T) {
lastTimeUpdateTortoise: make(map[client.ObjectKey]time.Time),
}

s.UpdateTortoisePhaseIfHPAIsUnhealthy(context.Background(), tt.args.scalingActive, tt.args.t)
tt.args.t, err := s.UpdateTortoisePhaseIfHPAIsUnhealthy(context.Background(), tt.args.scalingActive, tt.args.t)
if err != nil {
t.Fatalf("failed to update tortoise phase: %v", err)
}
if d := cmp.Diff(tt.args.t, tt.wantTortoise); d != "" {
t.Errorf("UpdateTortoiseStatus() diff = %v", d)
}
Expand Down

0 comments on commit 7c0e997

Please sign in to comment.