Skip to content

kustomize version command: invalid --output value fails silently #6032

@kfess

Description

@kfess

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions