Skip to content

call DeleteWorkload when a pending workload transitions to WorkloadOnHold - #12929

Merged
kubernetes-prow[bot] merged 1 commit into
kubernetes-sigs:mainfrom
anuragdalvi:fix-update-workload-onhold
Jul 10, 2026
Merged

kubernetes-prow[bot] merged 1 commit into
kubernetes-sigs:mainfrom
anuragdalvi:fix-update-workload-onhold

Conversation

@anuragdalvi

@anuragdalvi anuragdalvi commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

Fixed stale pending queue entries when a pending Workload transitions to on-hold.

Which issue(s) this PR fixes:

Fixes #12685

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Scheduling: Fixed stale scheduling queue entries for pending Workloads that transition
to `WorkloadOnHold`.

Summary by CodeRabbit

  • Bug Fixes
    • On-hold workloads are now removed from pending queues instead of remaining as stale entries.
    • Prevents on-hold workloads from appearing incorrectly in pending workload listings.

@kubernetes-prow kubernetes-prow Bot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/deprecation Categorizes issue or PR as related to a feature/enhancement marked for deprecation. kind/failing-test Categorizes issue or PR as related to a consistently or frequently failing test. labels Jul 10, 2026
@netlify

netlify Bot commented Jul 10, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for kubernetes-sigs-kueue ready!

Name Link
🔨 Latest commit a1e898a
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-sigs-kueue/deploys/6a5044732c918a00086b5790
😎 Deploy Preview https://deploy-preview-12929--kubernetes-sigs-kueue.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@kubernetes-prow kubernetes-prow Bot added kind/flake Categorizes issue or PR as related to a flaky test. kind/regression Categorizes issue or PR as related to a regression from a prior release. area/tas Topology-Aware Scheduling area/integrations Workload integrations area/multikueue Issues or PRs related to MultiKueue labels Jul 10, 2026
@kubernetes-prow
kubernetes-prow Bot requested review from kshalot and olekzabl July 10, 2026 01:01
@kubernetes-prow kubernetes-prow Bot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. area/dashboard Denotes a PR that is related to the built-in dashboard area/localization General issues or PRs related to localization needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. area/testing Testing - related stuff labels Jul 10, 2026
@kubernetes-prow

Copy link
Copy Markdown

Hi @anuragdalvi. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@kubernetes-prow kubernetes-prow Bot added area/website Issues or PRs related to the website size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 10, 2026
@coderabbitai

coderabbitai Bot commented Jul 10, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The pending-to-pending workload update path now deletes workloads that enter the on-hold state. A unit test verifies that an existing pending queue entry is removed when the workload receives the on-hold condition.

Changes

On-hold queue cleanup

Layer / File(s) Summary
Reconcile and validate on-hold queue removal
pkg/controller/core/workload_controller.go, pkg/controller/core/workload_controller_test.go
The reconciler calls DeleteWorkload for on-hold workloads, and a test verifies removal of a stale pending queue entry.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested labels: release-note-none

Suggested reviewers: PBundyra, sohankunkerkar, kannon92

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The code and test changes satisfy issue #12685 by removing stale queue entries for on-hold workloads.
Out of Scope Changes check ✅ Passed The changes are narrowly scoped to the queue cleanup fix and its regression test.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main fix: deleting queue entries when a pending workload becomes WorkloadOnHold.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@anuragdalvi

Copy link
Copy Markdown
Contributor Author

/remove-label area/dashboard
/remove-label area/integrations
/remove-label area/localization
/remove-label area/multikueue
/remove-label area/tas
/remove-label area/testing
/remove-label area/website
/remove-label kind/api-change
/remove-label kind/cleanup
/remove-label kind/deprecation
/remove-label kind/failing-test
/remove-label kind/flake
/remove-label kind/regression

@kubernetes-prow

Copy link
Copy Markdown

@anuragdalvi: The label(s) /remove-label area/dashboard , /remove-label area/integrations , /remove-label area/localization , /remove-label area/multikueue , /remove-label area/tas , /remove-label area/testing , /remove-label area/website , /remove-label kind/api-change , /remove-label kind/cleanup , /remove-label kind/deprecation , /remove-label kind/failing-test , /remove-label kind/flake , /remove-label kind/regression cannot be applied. These labels are supported: api-review, tide/merge-method-merge, tide/merge-method-rebase, tide/merge-method-squash, team/katacoda, refactor, ci-short, ci-extended, ci-full. Is this label configured under labels -> additional_labels or labels -> restricted_labels in plugin.yaml?

Details

In response to this:

/remove-label area/dashboard
/remove-label area/integrations
/remove-label area/localization
/remove-label area/multikueue
/remove-label area/tas
/remove-label area/testing
/remove-label area/website
/remove-label kind/api-change
/remove-label kind/cleanup
/remove-label kind/deprecation
/remove-label kind/failing-test
/remove-label kind/flake
/remove-label kind/regression

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@anuragdalvi

Copy link
Copy Markdown
Contributor Author

/remove-label area/dashboard

@kubernetes-prow

Copy link
Copy Markdown

@anuragdalvi: The label(s) /remove-label area/dashboard cannot be applied. These labels are supported: api-review, tide/merge-method-merge, tide/merge-method-rebase, tide/merge-method-squash, team/katacoda, refactor, ci-short, ci-extended, ci-full. Is this label configured under labels -> additional_labels or labels -> restricted_labels in plugin.yaml?

Details

In response to this:

/remove-label area/dashboard

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@anuragdalvi

Copy link
Copy Markdown
Contributor Author

/remove-area dashboard

@kubernetes-prow kubernetes-prow Bot removed the area/dashboard Denotes a PR that is related to the built-in dashboard label Jul 10, 2026
@anuragdalvi

Copy link
Copy Markdown
Contributor Author

/remove-area integrations
/remove-area localization
/remove-area multikueue
/remove-area tas
/remove-area testing
/remove-area website

@kubernetes-prow kubernetes-prow Bot added needs-kind Indicates a PR lacks a `kind/foo` label and requires one. and removed kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/deprecation Categorizes issue or PR as related to a feature/enhancement marked for deprecation. labels Jul 10, 2026
@anuragdalvi

Copy link
Copy Markdown
Contributor Author

/kind bug

@kubernetes-prow kubernetes-prow Bot added kind/bug Categorizes issue or PR as related to a bug. and removed kind/failing-test Categorizes issue or PR as related to a consistently or frequently failing test. kind/flake Categorizes issue or PR as related to a flaky test. kind/regression Categorizes issue or PR as related to a regression from a prior release. labels Jul 10, 2026
@mimowo

mimowo commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

/ok-to-test

@kubernetes-prow kubernetes-prow Bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 10, 2026
@mimowo

mimowo commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

/release-note-edit

Scheduling: Fixed stale scheduling queue entries for pending Workloads that transition
to `WorkloadOnHold`.

@kubernetes-prow kubernetes-prow Bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Jul 10, 2026
@mimowo

mimowo commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Thank you 👍
/lgtm
/approve

Let me try to prep the CPs, but for what I can see 0.17 will probably fail anyway. @anuragdalvi would you like to prep the CP manually for 0.17?
/cherrypick release-0.18
/cherrypick release-0.17

@k8s-infra-cherrypick-robot

Copy link
Copy Markdown
Contributor

@mimowo: once the present PR merges, I will cherry-pick it on top of release-0.17, release-0.18 in new PRs and assign them to you.

Details

In response to this:

Thank you 👍
/lgtm
/approve

Let me try to prep the CPs, but for what I can see 0.17 will probably fail anyway. @anuragdalvi would you like to prep the CP manually for 0.17?
/cherrypick release-0.18
/cherrypick release-0.17

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@kubernetes-prow kubernetes-prow Bot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 10, 2026
@kubernetes-prow

Copy link
Copy Markdown

LGTM label has been added.

DetailsGit tree hash: 1bbbce992cda7f67241eb0d7499872a0da0a55f2

@kubernetes-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: anuragdalvi, mimowo

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow kubernetes-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 10, 2026
@kubernetes-prow
kubernetes-prow Bot merged commit a27c6fd into kubernetes-sigs:main Jul 10, 2026
55 checks passed
@kubernetes-prow kubernetes-prow Bot added this to the v0.19 milestone Jul 10, 2026
@k8s-infra-cherrypick-robot

Copy link
Copy Markdown
Contributor

@mimowo: new pull request created: #12942

Details

In response to this:

Thank you 👍
/lgtm
/approve

Let me try to prep the CPs, but for what I can see 0.17 will probably fail anyway. @anuragdalvi would you like to prep the CP manually for 0.17?
/cherrypick release-0.18
/cherrypick release-0.17

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-infra-cherrypick-robot

Copy link
Copy Markdown
Contributor

@mimowo: #12929 failed to apply on top of branch "release-0.17":

Applying: call DeleteWorkload when a pending workload transitions to WorkloadOnHold
Using index info to reconstruct a base tree...
M	pkg/controller/core/workload_controller.go
M	pkg/controller/core/workload_controller_test.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/controller/core/workload_controller.go
CONFLICT (content): Merge conflict in pkg/controller/core/workload_controller.go
Auto-merging pkg/controller/core/workload_controller_test.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 call DeleteWorkload when a pending workload transitions to WorkloadOnHold

Details

In response to this:

Thank you 👍
/lgtm
/approve

Let me try to prep the CPs, but for what I can see 0.17 will probably fail anyway. @anuragdalvi would you like to prep the CP manually for 0.17?
/cherrypick release-0.18
/cherrypick release-0.17

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@anuragdalvi

Copy link
Copy Markdown
Contributor Author

@mimowo Thanks for the CP for release-0.17

@mimowo

mimowo commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Np, we have a release today so I wanted to make sure it doesn't slip. Normally, I would just leave it to the contributor

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clean up stale queue entry when workload transitions to WorkloadOnHold

4 participants