Skip to content

Commit

Permalink
vpa-recommender: Use the MaintainCheckpoints context only for that step
Browse files Browse the repository at this point in the history
  • Loading branch information
ialidzhikov committed Sep 11, 2024
1 parent 2800c70 commit 9c16c99
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,6 @@ func (r *recommender) RunOnce() {
defer timer.ObserveTotal()

ctx := context.Background()
ctx, cancelFunc := context.WithDeadline(ctx, time.Now().Add(*checkpointsWriteTimeout))
defer cancelFunc()

klog.V(3).Infof("Recommender Run")

Expand All @@ -167,7 +165,9 @@ func (r *recommender) RunOnce() {
r.UpdateVPAs()
timer.ObserveStep("UpdateVPAs")

r.MaintainCheckpoints(ctx, *minCheckpointsPerRun)
stepCtx, cancelFunc := context.WithDeadline(ctx, time.Now().Add(*checkpointsWriteTimeout))
defer cancelFunc()
r.MaintainCheckpoints(stepCtx, *minCheckpointsPerRun)
timer.ObserveStep("MaintainCheckpoints")

r.clusterState.RateLimitedGarbageCollectAggregateCollectionStates(ctx, time.Now(), r.controllerFetcher)
Expand Down

0 comments on commit 9c16c99

Please sign in to comment.