Skip to content

Commit

Permalink
fix rebalancer auto deleted failed
Browse files Browse the repository at this point in the history
Signed-off-by: chaosi-zju <[email protected]>
  • Loading branch information
chaosi-zju committed Dec 28, 2024
1 parent 8fa7c2c commit 078d3e6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func (c *RebalancerController) Reconcile(ctx context.Context, req controllerrunt
return controllerruntime.Result{}, err
}

if rebalancer.Status.FinishTime == nil {
if newStatus.FinishTime == nil {
// should never reach here.
klog.Errorf("finishTime shouldn't be nil, current status: %+v", rebalancer.Status)
return controllerruntime.Result{}, nil
Expand Down
6 changes: 6 additions & 0 deletions test/e2e/workloadrebalancer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,12 @@ var _ = framework.SerialDescribe("workload rebalancer testing", func() {
framework.WaitRebalancerDisappear(karmadaClient, rebalancerName)
})
})

ginkgo.It("create rebalancer with ttl and verify it can auto clean", func() {
rebalancer.Spec.TTLSecondsAfterFinished = ptr.To[int32](5)
framework.CreateWorkloadRebalancer(karmadaClient, rebalancer)
framework.WaitRebalancerDisappear(karmadaClient, rebalancerName)
})
})

// 2. static weight scheduling
Expand Down

0 comments on commit 078d3e6

Please sign in to comment.