Skip to content

Commit

Permalink
fix(nodeclaim): set and sleep only when the nodeclaim becomes consoli…
Browse files Browse the repository at this point in the history
…datable

Signed-off-by: flavono123 <[email protected]>
  • Loading branch information
flavono123 committed Feb 22, 2025
1 parent 518ff10 commit 155c1ec
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/controllers/nodeclaim/disruption/consolidation.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ func (c *Consolidation) Reconcile(ctx context.Context, nodePool *v1.NodePool, no
}

// 3. Otherwise, add the consolidatable status condition if not already set
nodeClaim.StatusConditions().SetTrue(v1.ConditionTypeConsolidatable)
// We sleep here after a set operation since we want to ensure that we are able to read our own writes
// so that we avoid duplicating log lines due to quick re-queues from our node watcher
time.Sleep(100 * time.Millisecond)

if !hasConsolidatableCondition {
nodeClaim.StatusConditions().SetTrue(v1.ConditionTypeConsolidatable)
// We sleep here after a set operation since we want to ensure that we are able to read our own writes
// so that we avoid duplicating log lines due to quick re-queues from our node watcher
time.Sleep(100 * time.Millisecond)

log.FromContext(ctx).V(1).Info("marking consolidatable")
}
return reconcile.Result{}, nil
Expand Down

0 comments on commit 155c1ec

Please sign in to comment.