Skip to content

Commit

Permalink
tmp: don't reconcile pod resources when autoscaling disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
sharnoff committed Dec 12, 2024
1 parent 5b02227 commit d987506
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/plugin/handle_pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,13 @@ func (s *PluginState) reconcilePodResources(
retryAfter *time.Duration,
unlock func(),
) (needsMoreResources bool, _ error) {
// Quick check: Does this pod have autoscaling enabled? if no, then we shouldn't set our
// annotations on it -- particularly because we may end up with stale approved resources when
// the VM scales, and that can cause issues if autoscaling is enabled later.
if !api.HasAutoscalingEnabled(oldPodObj) {
return false, nil
}

desiredPod := oldPod
ns.node.Speculatively(func(n *state.Node) (commit bool) {
// Do a pass of reconciling this pod, in case there's resources it's requested that we can
Expand Down

0 comments on commit d987506

Please sign in to comment.