Skip to content

cli: --output-format flag is not always honored #893

@lilioid

Description

@lilioid

Description

The --output-format flag is not always honored.
For example, if one runs a stackit ske cluster list -o json on a project that has SKE enabled but where no clusters yet exist, the CLI only outputs a plaintext error.
With the current behavior, it is not easily possible to use the STACKIT cli in scripts because one cannot always parse the output correctly.

Steps to reproduce

  1. Run stackit ske cluster list --project-id=… -o json on a project where SKE is enabled but where no cluster has yet been created

Actual behavior

The CLI exits with exit code 0 (which is fine) and the following plaintext output:

No clusters found for project "…"

Expected behavior

The CLI should exit with code 0 and print [] to stdout.

Environment

  • OS: Linux
  • Version of STACKIT CLI (see stackit --version): v0.32.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions