Skip to content

Commit

Permalink
refactor: improve error messaging for version command
Browse files Browse the repository at this point in the history
  • Loading branch information
ssttehrani committed Jan 11, 2024
1 parent fd59eb9 commit d3664c4
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 d3664c4

Please sign in to comment.