Repository navigation
fix(kubectl): support global flags + exec/delete/rollout subcommands (#927) - #2478
Open
ousamabenyounes wants to merge 2 commits into
Open
ousamabenyounes wants to merge 2 commits into
ousamabenyounes wants to merge 2 commits into
Conversation
ousamabenyounes
force-pushed
the
fix/issue-927
branch
from
July 9, 2026 12:38
2543dfa to
f5955d1
Compare
Contributor
Author
|
Rebased this PR onto current It is mergeable again with no base lag. Waiting for review when you have a moment, @aeppling. |
ousamabenyounes
force-pushed
the
fix/issue-927
branch
3 times, most recently
from
August 4, 2026 18:55
ef2ef30 to
c671731
Compare
ousamabenyounes
force-pushed
the
fix/issue-927
branch
from
August 15, 2026 22:47
c671731 to
eb0468a
Compare
…commands (rtk-ai#927) The classify/rewrite pattern only matched subcommands in first position, so `kubectl --context foo get pods` or `kubectl -n ns exec pod` were not rewritten by the hook or flagged as missed savings. Update the RtkRule pattern to skip zero or more global flags (--long-opt[=val|-n val) before matching the subcommand, and extend the subcommand list from 4 to 19 entries (exec, delete, create, patch, rollout, scale, port-forward, top, diff, wait, events, run, expose, auth, cp, version, config, api-resources, label, annotate, edit, replace, cordon, drain, taint). Add regression tests for --context, -n, and exec cases. Closes rtk-ai#927 Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
`rewrite_command` now requires a third `transparent_prefixes: &[String]` argument on develop. Update the 3 kubectl global-flag assertions added in this PR to pass `&[]` so the project compiles cleanly post-rebase. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
ousamabenyounes
force-pushed
the
fix/issue-927
branch
from
October 16, 2026 22:36
eb0468a to
d6a0135
Compare
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #927.
The kubectl rewrite/classify rules missed several real-world invocation shapes: the
--context/-nglobal flags placed before the subcommand, theexecanddeletesubcommands, and variable-assignment prefixes. As a result those commands were not routed through the RTK filter.Fix
Extend the kubectl rules in
src/discover/rules.rsto recognise the missing subcommands (exec,delete,rollout, …) and global flags, so they classify and rewrite correctly.Test verification (RED → GREEN)
RED —
src/discover/rules.rsreverted to develop:GREEN — with the fix:
(Re-proposes the accidentally-closed #1196, rebased onto current
develop.)