flux2 icon indicating copy to clipboard operation
flux2 copied to clipboard

Incorrect error message regarding cli

Open gecube opened this issue 11 months ago • 4 comments

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

gecube avatar Mar 26 '25 04:03 gecube

Like most Go CLIs we use spf13/cobra, I think this issue is for them

matheuscscp avatar Mar 26 '25 08:03 matheuscscp

@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.

gecube avatar Mar 26 '25 08:03 gecube

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

gecube avatar Apr 06 '25 13:04 gecube

yep I got the ✗ unknown flag: --owner because I made a typo in flux bootstrap ithub

Sleepful avatar Apr 15 '25 04:04 Sleepful