Incorrect error message regarding cli
Describe the bug
flux reconcile kustosmization flux-system --with-source
✗ unknown flag: --with-source
should be something like "kustosmization is incorrect subcommand for reconcile".
Yes, I know that I typed incorrect command and it should be:
flux reconcile kustomization flux-system --with-source
Steps to reproduce
up
Expected behavior
The flux cli should present a correct error message.
Screenshots and recordings
No response
OS / Distro
ubuntu
Flux version
v2.5.1
Flux check
► checking prerequisites ✔ Kubernetes 1.31.6+k3s1 >=1.30.0-0 ► checking version in cluster ✔ distribution: flux-v2.5.1 ✔ bootstrapped: true ► checking controllers ✔ helm-controller: deployment ready ► ghcr.io/fluxcd/helm-controller:v1.2.0 ✔ image-automation-controller: deployment ready ► ghcr.io/fluxcd/image-automation-controller:v0.40.0 ✔ image-reflector-controller: deployment ready ► ghcr.io/fluxcd/image-reflector-controller:v0.34.0 ✔ kustomize-controller: deployment ready ► ghcr.io/fluxcd/kustomize-controller:v1.5.1 ✔ notification-controller: deployment ready ► ghcr.io/fluxcd/notification-controller:v1.5.0 ✔ source-controller: deployment ready ► ghcr.io/fluxcd/source-controller:v1.5.0 ► checking crds ✔ alerts.notification.toolkit.fluxcd.io/v1beta3 ✔ buckets.source.toolkit.fluxcd.io/v1 ✔ gitrepositories.source.toolkit.fluxcd.io/v1 ✔ helmcharts.source.toolkit.fluxcd.io/v1 ✔ helmreleases.helm.toolkit.fluxcd.io/v2 ✔ helmrepositories.source.toolkit.fluxcd.io/v1 ✔ imagepolicies.image.toolkit.fluxcd.io/v1beta2 ✔ imagerepositories.image.toolkit.fluxcd.io/v1beta2 ✔ imageupdateautomations.image.toolkit.fluxcd.io/v1beta2 ✔ kustomizations.kustomize.toolkit.fluxcd.io/v1 ✔ ocirepositories.source.toolkit.fluxcd.io/v1beta2 ✔ providers.notification.toolkit.fluxcd.io/v1beta3 ✔ receivers.notification.toolkit.fluxcd.io/v1 ✔ all checks passed
Git provider
No response
Container Registry provider
No response
Additional context
No response
Code of Conduct
- [x] I agree to follow this project's Code of Conduct
Like most Go CLIs we use spf13/cobra, I think this issue is for them
@matheuscscp thanks ! Could we somehow reformulate the issue and post to cobra repo? As I am not sure how to explain the thing and it would be a little bit complicated to me to explain the internals of the bug.
The same:
flux bootstrap --owner=chargexam --repository=hetzner --path=clusters/hetzner --components-extra='image-reflector-controller,image-automation-controller' --read-write-key
✗ unknown flag: --owner
should report that subcommand was not chosen...
The proper one:
flux bootstrap gitlab --owner=chargexam --repository=hetzner --path=clusters/hetzner --components-extra='image-reflector-controller,image-automation-controller' --read-write-key
yep I got the ✗ unknown flag: --owner because I made a typo in flux bootstrap ithub