Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: improve error messaging for version command #2231

Merged
merged 1 commit into from
Jan 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
refactor: improve error messaging for version command
Signed-off-by: ssttehrani <[email protected]>
ssttehrani committed Jan 11, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit b1f953b2763fc0bec23bd01c7869e6a5f2f37369
4 changes: 2 additions & 2 deletions internal/cli/cmd/version.go
Original file line number Diff line number Diff line change
@@ -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)
}