Skip to content

Commit

Permalink
version: report the cilium images version
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandre Perrin <[email protected]>
  • Loading branch information
kaworu committed Jun 7, 2021
1 parent 05dc67b commit 8bdf4e2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions defaults/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,8 @@ var (
// CiliumPodSelector is the pod selector to be used for the Cilium agents.
CiliumPodSelector = "k8s-app=cilium"
)

// CiliumVersion return the default Cilium version used by the cli.
func CiliumVersion() string {
return Version
}
7 changes: 5 additions & 2 deletions internal/cli/cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import (
"fmt"
"runtime"

"github.com/cilium/cilium-cli/defaults"

"github.com/spf13/cobra"
)

Expand All @@ -44,8 +46,9 @@ func newCmdVersion() *cobra.Command {
case GitHash != "":
gitInfo = fmt.Sprintf("@%s", GitHash)
}
// TODO: add support for reporting the Cilium version
fmt.Printf("cilium-cli: v%s%s compiled with %v on %v/%v\n", Version, gitInfo, runtime.Version(), runtime.GOOS, runtime.GOARCH)
// TODO: add support for reporting the Cilium version running in
// the cluster, if any.
fmt.Printf("cilium-cli: v%s%s (%s images) compiled with %v on %v/%v\n", Version, gitInfo, defaults.CiliumVersion(), runtime.Version(), runtime.GOOS, runtime.GOARCH)
},
}
}

0 comments on commit 8bdf4e2

Please sign in to comment.