skupper icon indicating copy to clipboard operation
skupper copied to clipboard

skupper cli shows help screen even when failing due to issue unrelated to usage (podman)

Open hash-d opened this issue 1 year ago • 0 comments

Describe the bug

When creating a link but the associated DNS name does not exist, the skupper command usage is shown, along with the actual error.

I believe we removed that behavior from other commands in the past (though I cannot find issues, PRs or commits that did that to record here).

How To Reproduce

  • Create a token on some Skupper installation; change its skupper.io/url annotation so the URL becomes invalid
  • Try to create a link using that token on a podman site:
$ skupper --platform podman link create /tmp/token
Claim request failed on invoke: Post "https://asdf.com:8081/2b10e9b8-7049-11ef-a4c1-82938172de19?site-version=1.8.0-rh-1": dial tcp: lookup asdf.com: no such host
Error: Error processing claim "link1": Post "https://asdf.com:8081/2b10e9b8-7049-11ef-a4c1-82938172de19?site-version=1.8.0-rh-1": dial tcp: lookup asdf.com: no such host
Usage:
  skupper link create <input-token-file> [flags]

Flags:
      --cost int32    Specify a cost for this link. (default 1)
  -h, --help          help for create
      --name string   Provide a specific name for the link (used when deleting it)

Global Flags:
      --platform string   The platform type to use [kubernetes, podman]

Alternativelly, just try to create a link from /dev/null:

 $ skupper --platform podman link create /dev/null 
 Error: invalid Skupper token
 Usage:
   skupper link create <input-token-file> [flags]
 
 Flags:
       --cost int32    Specify a cost for this link. (default 1)
   -h, --help          help for create
       --name string   Provide a specific name for the link (used when deleting it)
 
 Global Flags:
       --platform string   The platform type to use [kubernetes, podman]

Expected behavior

Show only the error, not the usage message (as usage is ok)

Environment details

  • Skupper CLI: 1.8.0
  • Skupper Operator (if applicable): N/A
  • Platform: podman

Additional context N/A

hash-d avatar Sep 11 '24 14:09 hash-d