Skip to content

feat(kubectl): add global flags --context, --kubeconfig, -n, -l, --as#293

Open
mariusvniekerk wants to merge 1 commit intortk-ai:masterfrom
mariusvniekerk:feat/kubectl-global-args
Open

feat(kubectl): add global flags --context, --kubeconfig, -n, -l, --as#293
mariusvniekerk wants to merge 1 commit intortk-ai:masterfrom
mariusvniekerk:feat/kubectl-global-args

Conversation

@mariusvniekerk
Copy link

Summary

  • Add KubectlGlobalArgs struct with --context, --kubeconfig, -n/--namespace, -l/--selector, and --as flags
  • Flatten into pods, services, and logs subcommands via #[command(flatten)]
  • Forward all global args to the underlying kubectl binary
  • Previously only -n was supported on pods/services, and logs had no namespace/context support

Test plan

  • 5 new CLI parsing tests covering all flags and combinations
  • All 435 tests pass
  • Manual verification: rtk kubectl get --context foo -n blah somecrd a correctly passes through

kubectl subcommands (pods, services, logs) now accept common global
flags that are forwarded to the underlying kubectl binary. Previously
only -n was supported on pods/services, and logs had no namespace
support at all.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant