Skip to content

Commit 518ff10

Browse files
committed
fix(nodeclaim): dedup logs marking consolidatable
Signed-off-by: flavono123 <[email protected]>
1 parent c0e7299 commit 518ff10

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pkg/controllers/nodeclaim/disruption/consolidation.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package disruption
1818

1919
import (
2020
"context"
21+
"time"
2122

2223
"github.com/samber/lo"
2324
"k8s.io/utils/clock"
@@ -69,8 +70,12 @@ func (c *Consolidation) Reconcile(ctx context.Context, nodePool *v1.NodePool, no
6970
return reconcile.Result{RequeueAfter: consolidatableTime.Sub(c.clock.Now())}, nil
7071
}
7172

72-
// 6. Otherwise, add the consolidatable status condition
73+
// 3. Otherwise, add the consolidatable status condition if not already set
7374
nodeClaim.StatusConditions().SetTrue(v1.ConditionTypeConsolidatable)
75+
// We sleep here after a set operation since we want to ensure that we are able to read our own writes
76+
// so that we avoid duplicating log lines due to quick re-queues from our node watcher
77+
time.Sleep(100 * time.Millisecond)
78+
7479
if !hasConsolidatableCondition {
7580
log.FromContext(ctx).V(1).Info("marking consolidatable")
7681
}

0 commit comments

Comments
 (0)