Skip to content

rfac: handle paused scaling directly in reconciler#7664

Open
rickbrouwer wants to merge 2 commits intokedacore:mainfrom
rickbrouwer:paused
Open

rfac: handle paused scaling directly in reconciler#7664
rickbrouwer wants to merge 2 commits intokedacore:mainfrom
rickbrouwer:paused

Conversation

@rickbrouwer
Copy link
Copy Markdown
Member

@rickbrouwer rickbrouwer commented Apr 18, 2026

The ScaledObject reconciler now handles the full pause lifecycle: stop scale loop, delete HPA, and scale the target directly via the scale subresource instead of recreating an HPA with min=max=N. This applies consistently to both paused and paused-replicas annotations.

Also aligned the ScaledJob pause flow with the same status-first pattern and idempotent scale loop stopping.
Added e2e tests for HPA absence during pause, annotation value changes and annotation switching while paused.

Checklist

  • I have verified that my change is according to the deprecations & breaking changes policy
  • Tests have been added (if applicable)
  • Ensure make generate-scalers-schema has been run to update any outdated generated files
  • Changelog has been updated and is aligned with our changelog requirements, only when the change impacts end users
  • Commits are signed with Developer Certificate of Origin (DCO - learn more)

Fixes #7663

@github-actions
Copy link
Copy Markdown

Thank you for your contribution! 🙏

Please understand that we will do our best to review your PR and give you feedback as soon as possible, but please bear with us if it takes a little longer as expected.

While you are waiting, make sure to:

  • Add an entry in our changelog in alphabetical order and link related issue
  • Update the documentation, if needed
  • Add unit & e2e tests for your changes
  • GitHub checks are passing
  • Is the DCO check failing? Here is how you can fix DCO issues

Once the initial tests are successful, a KEDA member will ensure that the e2e tests are run. Once the e2e tests have been successfully completed, the PR may be merged at a later date. Please be patient.

Learn more about our contribution guide.

@keda-automation keda-automation requested review from a team April 18, 2026 19:31
@snyk-io
Copy link
Copy Markdown

snyk-io Bot commented Apr 18, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@rickbrouwer
Copy link
Copy Markdown
Member Author

rickbrouwer commented Apr 18, 2026

/run-e2e internal
Update: You can check the progress here

Signed-off-by: Rick Brouwer <rickbrouwer@gmail.com>
@rickbrouwer
Copy link
Copy Markdown
Member Author

rickbrouwer commented Apr 18, 2026

/run-e2e internal
Update: You can check the progress here

@rickbrouwer rickbrouwer marked this pull request as ready for review April 19, 2026 06:57
@rickbrouwer rickbrouwer mentioned this pull request Apr 20, 2026
22 tasks
Comment thread pkg/scaling/executor/scale_scaledobjects.go Outdated
Comment thread controllers/keda/scaledobject_controller.go Outdated
Signed-off-by: Rick Brouwer <rickbrouwer@gmail.com>
@keda-automation keda-automation requested a review from a team April 21, 2026 09:13
@rickbrouwer rickbrouwer added the Awaiting/2nd-approval This PR needs one more approval review label Apr 21, 2026
@rickbrouwer
Copy link
Copy Markdown
Member Author

rickbrouwer commented Apr 21, 2026

/run-e2e internal
Update: You can check the progress here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Awaiting/2nd-approval This PR needs one more approval review required:keda-v2.20

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent HPA lifecycle and race conditions in ScaledObject pause handling

2 participants