Skip to content

Commit

Permalink
refactor: improve error messaging for version command
Browse files Browse the repository at this point in the history
Signed-off-by: ssttehrani <[email protected]>
  • Loading branch information
ssttehrani authored and tklauser committed Jan 12, 2024
1 parent e10f48b commit 1932fed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/cli/cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ func newCmdVersion() *cobra.Command {
return nil
}
version, err := k8sClient.GetRunningCiliumVersion(context.Background(), namespace)
if version == "" || err != nil {
fmt.Printf("cilium image (running): unknown. Unable to obtain cilium version, no cilium pods found in namespace %q\n", namespace)
if err != nil {
fmt.Printf("cilium image (running): unknown. Unable to obtain cilium version. Reason: %s\n", err.Error())
} else {
fmt.Printf("cilium image (running): %s\n", version)
}
Expand Down

0 comments on commit 1932fed

Please sign in to comment.