Skip to content

Accept TYPE/NAME resource args in get/reconcile - #6134

Merged
stefanprodan merged 1 commit into
fluxcd:mainfrom
souvik-biswas-dev:feat/kubectl-style-resource-args
Oct 22, 2026
Merged

stefanprodan merged 1 commit into
fluxcd:mainfrom
souvik-biswas-dev:feat/kubectl-style-resource-args

Conversation

@souvik-biswas-dev

@souvik-biswas-dev souvik-biswas-dev commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Part of: #6130

flux get and flux reconcile now accept kubectl-style TYPE/NAME resource arguments, so commands copied from kubectl history work as-is. For example, flux get hr/podinfo and flux reconcile helmreleases.helm.toolkit.fluxcd.io/podinfo now behave the same as flux get helmrelease podinfo and flux reconcile helmrelease podinfo.

How: the arguments are rewritten to the existing "TYPE NAME" form before cobra dispatches, so sub-command flags and behavior are unchanged. An optional API version and group are checked against the registered Flux types. Arguments that don't match are left as they are.

Scope: get and reconcile for runnable resource types; nested groups like "source git" aren't covered yet.

Tests: unit tests for the parsing and envtest tests comparing the new forms to the existing ones.

Allow the get and reconcile commands to take kubectl-style resource
arguments, e.g. "flux get hr/podinfo" or "flux reconcile
helmreleases.helm.toolkit.fluxcd.io/podinfo", so that commands from
kubectl history can be reused.

The arguments are rewritten to the existing "TYPE NAME" form before
cobra dispatches, so sub-command flags and behavior are unchanged. An
optional API version and group are checked against the registered Flux
types. Arguments that don't match are left as they are.

Signed-off-by: Souvik Biswas <souvikbiswas.dev@gmail.com>
@stefanprodan stefanprodan added the area/ux In pursuit of a delightful user experience label Oct 22, 2026

@stefanprodan stefanprodan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thanks @souvik-biswas-dev 🏅

PS. This partially covers the Flux type, we'll do a followup for the nested source/image commands.

@stefanprodan
stefanprodan merged commit e96d599 into fluxcd:main Oct 22, 2026
7 checks passed
@souvik-biswas-dev
souvik-biswas-dev deleted the feat/kubectl-style-resource-args branch October 22, 2026 08:35
@souvik-biswas-dev

Copy link
Copy Markdown
Contributor Author

Thanks for the quick review and the merge @stefanprodan Glad it's useful.

If you're okay with it, I'd be happy to pick up the follow-up for the nested source/image commands (like flux get source git). Let me know if you'd like me to take it, or if you'd rather handle it yourself. I'll wait for your go-ahead before starting.

@stefanprodan

Copy link
Copy Markdown
Member

@souvik-biswas-dev I'm going to do a followup for this

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

Development

Successfully merging this pull request may close these issues.

2 participants