Skip to content

Extend kubectl-style resource args to all Flux kinds and commands - #6135

Merged
stefanprodan merged 7 commits into
mainfrom
kubectl-style-args-map
Oct 22, 2026
Merged

stefanprodan merged 7 commits into
mainfrom
kubectl-style-args-map

Conversation

@stefanprodan

Copy link
Copy Markdown
Member

#6134 resolved TYPE/NAME arguments only for direct children of get and reconcile, so sources and image types were not supported. This PR resolves them through a table of Flux kinds and extends the syntax to the other resource commands.

Examples:

flux get hr/podinfo
flux reconcile helmreleases.helm.toolkit.fluxcd.io/podinfo --with-source
flux suspend gitrepo/frontend gitrepo/backend
flux resume kustomizations frontend backend
flux resume ImagePolicy.v1.image.toolkit.fluxcd.io/podinfo
flux get ks frontend backend
flux delete ks/podinfo --silent

Solved issues:

Superseded PRs (original authors are credited on commits with Co-authored-by):

stefanprodan and others added 7 commits October 22, 2026 14:58
Resolve kubectl-style resource arguments through a table of Flux
kinds, so sources and image types work in get and reconcile, e.g.
"flux reconcile gitrepo/flux-system". Reject additional resource
arguments instead of silently ignoring them.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
Extend kubectl-style resource arguments to the suspend, resume,
export and delete commands. Suspend and resume accept several
TYPE/NAME arguments of the same kind, e.g.
"flux suspend gitrepo/podinfo gitrepo/flux-system".

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
The export loop returned after printing the first secret, so only the
first source with credentials was exported. Print every source and
each referenced secret once.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
The envtest kubeconfig was always written to /tmp/kubeconfig-1ns, so
concurrent test runs used each other's API servers. Write it to a
unique temporary file and remove it when the test env stops.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
Co-authored-by: Nikolaus Schuetz <nikolauspschuetz@gmail.com>
The get, reconcile, delete and export commands read only the first
name and silently ignored the rest. Process every name like suspend
and resume do: report each failure, keep going, and return an error
if any name failed. Several TYPE/NAME arguments of the same kind are
accepted by all commands.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
Co-authored-by: immanuwell <pchpr.00@list.ru>
Commands like "flux reconcile kustomizations podinfo" failed because
reconcile takes the singular form. When cobra finds no sub-command for
a known Flux type name, map it like a TYPE/NAME argument.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
Replace flux-system in the new examples, which reads like a namespace.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
@stefanprodan stefanprodan added the area/ux In pursuit of a delightful user experience label Oct 22, 2026
@stefanprodan
stefanprodan merged commit 6c1dd03 into main Oct 22, 2026
7 checks passed
@stefanprodan
stefanprodan deleted the kubectl-style-args-map branch October 22, 2026 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ux In pursuit of a delightful user experience

Projects

None yet

2 participants