kustomize icon indicating copy to clipboard operation
kustomize copied to clipboard

`kustomize version` command: invalid --output value fails silently

Open kfess opened this issue 3 weeks ago • 1 comments

What happened?

While this is a very minor usability issue, it could help other users avoid the same confusion I experienced.

When using the kustomize version command with an invalid --output flag, the command succeeds (exit code 0) but produces no output.

I'm used to using kubectl commands with --output=yaml, and occasionally I mistype it as --output=yml. With kubectl, I get an immediate error, but kustomize silently failed without any feedback.

What did you expect to happen?

The command should return an error message indicating that the output format is invalid.

Expected error message:

# the same message as `kubectl version` with invalid `--output` flag
error: --output must be 'yaml' or 'json'

How can we reproduce it (as minimally and precisely as possible)?

Run the following command with an invalid output format:

$ kustomize version --output=yml
# silently fails

Expected output


Actual output


Kustomize version

v5.8.0

Operating system

Linux

kfess avatar Dec 01 '25 15:12 kfess

I agree with the opinion that it would be better to standardize the behavior.

/triage accepted /priority important-longterm

koba1t avatar Dec 14 '25 19:12 koba1t