Repository navigation
Fix --dry-run flag ignored in kueuectl resume/stop localqueue and clusterqueue - #12617
Conversation
…sterqueue
The --dry-run flag is registered on the parent resume/stop commands via
flags.AddDryRunFlag as a PersistentFlag, making it available to all
subcommands. However, the LocalQueue and ClusterQueue subcommands
ignored this flag entirely, always performing the server-side Patch
regardless of the user's --dry-run=client or --dry-run=server setting.
This brings LocalQueue and ClusterQueue handling in line with the
existing Workload implementation in UpdateWorkloadActivationOptions,
which correctly gates the Patch call on DryRunStrategy.
For --dry-run=client: skip the Patch call entirely.
For --dry-run=server: pass DryRun: []string{metav1.DryRunAll} to PatchOptions.
For --dry-run=none (default): behavior is unchanged.
Signed-off-by: Jathavedhan M <jathavedhan.m@ibm.com>
✅ Deploy Preview for kubernetes-sigs-kueue ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Hi @carterpewpew. 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 Tip We noticed you've done this a few times! Consider joining the org to skip this step and gain Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughAdds ChangesDry-run support for stop/resume commands
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
/ok-to-test |
|
/lgtm |
|
LGTM label has been added. DetailsGit tree hash: d6f4db0ba30fb1367f88acfc2b16cf6134723569 |
|
/cherrypick release-0.18 |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: carterpewpew, mimowo The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@mimowo: once the present PR merges, I will cherry-pick it on top of DetailsIn response to this:
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. |
|
@mimowo: new pull request created: #12624 DetailsIn response to this:
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. |
|
@mimowo: new pull request created: #12627 DetailsIn response to this:
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. |
What type of PR is this?
/kind bug
What this PR does / why we need it:
The
--dry-runflag is registered as aPersistentFlagon the parentresumeandstopcommands, making it available to all subcommands includinglocalqueueandclusterqueue. However, these subcommands ignored the flag entirely, always performing the server-side Patch regardless of--dry-run=clientor--dry-run=server.This PR brings LocalQueue and ClusterQueue handling in line with the existing Workload implementation in
UpdateWorkloadActivationOptions, which correctly gates the Patch call onDryRunStrategy:--dry-run=client: skip the Patch call entirely, print the locally-modified object.--dry-run=server: passDryRun: []string{metav1.DryRunAll}toPatchOptions.--dry-run=none(default): behavior is unchanged.Which issue(s) this PR fixes:
Fixes #12565
Special notes for your reviewer:
The fix applies the identical pattern across 4 files (
resume_localqueue.go,resume_clusterqueue.go,stop_localqueue.go,stop_clusterqueue.go). Each change is structurally the same:DryRunStrategy dryrun.Strategyfield to the options struct.Complete()viadryrun.GetStrategy(cmd)anddryrun.PrintFlagsWithStrategy().Patch()call inRun()behindo.DryRunStrategy != dryrun.Client, and setopts.DryRunfor server-side dry-run.Complete()parameter order follows the existing codebase convention (clientGetter, cmd, args).Integration tests cover both
--dry-run=clientand--dry-run=serverfor all four affected subcommands.Does this PR introduce a user-facing change?
Summary by CodeRabbit
New Features
--dry-runsupport tokueuectl resumeandkueuectl stopfor both LocalQueue and ClusterQueue commands.Tests