Skip to content

Commit

Permalink
Fix cluster_wide_install test
Browse files Browse the repository at this point in the history
  • Loading branch information
burmanm committed Feb 18, 2025
1 parent 2f22b49 commit 990d1a1
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions pkg/reconciliation/reconcile_datacenter.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,24 @@ func (rc *ReconciliationContext) ProcessDeletion() result.ReconcileResult {
return result.Error(err)
}

if res := rc.CheckRackCreation(); res.Completed() {
return res
}

waitingForRackScale := false
for _, sts := range rc.statefulSets {
currentReplicas := int(*sts.Spec.Replicas)
if currentReplicas > 0 {
waitingForRackScale = true
if err := rc.UpdateRackNodeCount(sts, 0); err != nil {
return result.Error(err)
for _, rackInfo := range rc.desiredRackInformation {
sts, statefulSetFound, err := rc.GetStatefulSetForRack(rackInfo)
if err != nil {
rc.ReqLogger.Error(
err,
"Could not locate statefulSet for",
"Rack", rackInfo.RackName)
return result.Error(err)
}

if statefulSetFound {
currentReplicas := int(*sts.Spec.Replicas)
if currentReplicas > 0 {
waitingForRackScale = true
if err := rc.UpdateRackNodeCount(sts, 0); err != nil {
return result.Error(err)
}
}
}
}
Expand Down

0 comments on commit 990d1a1

Please sign in to comment.