Skip to content

Commit

Permalink
BACKPORT: plugin: Fix missing continue when skipping completed pods (
Browse files Browse the repository at this point in the history
…#342)

ref https://neondb.slack.com/archives/C03F5SM1N02/p1687222026730729?thread_ts=1687205072.505319&cid=C03F5SM1N02

Kind of a silly bug, that really could have been caught by tests, but oh
well.

Given it's currently impacting prod, I'll backport this onto v0.10.1, so
that (a) we're not waiting on cutting tomorrow's release to fix it, and
(b) we're not tying other things into this.
  • Loading branch information
sharnoff committed Jun 20, 2023
1 parent 353499f commit 4cb6e47
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/plugin/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,7 @@ func (p *AutoscaleEnforcer) readClusterState(ctx context.Context, logger *zap.Lo
continue
} else if util.PodCompleted(pod) {
logSkip("Pod is in its final, complete state (phase = %q), so will not use any resources", pod.Status.Phase)
continue
}

vmInfo, err := api.ExtractVmInfo(logger, vm)
Expand Down Expand Up @@ -1073,6 +1074,7 @@ func (p *AutoscaleEnforcer) readClusterState(ctx context.Context, logger *zap.Lo

if util.PodCompleted(pod) {
logSkip("Pod is in its final, complete state (phase = %q), so will not use any resources", pod.Status.Phase)
continue
}

if _, ok := p.state.podMap[podName]; ok {
Expand Down

0 comments on commit 4cb6e47

Please sign in to comment.