Print etcd version when calling openshift version
@@ -3,6 +3,7 @@ package version
import (
"fmt"
+ etcdversion "github.com/coreos/etcd/version"
"github.com/prometheus/client_golang/prometheus"
"github.com/spf13/cobra"
kubeversion "k8s.io/kubernetes/pkg/version"
@@ -52,13 +53,16 @@ func (info Info) String() string {
}
// NewVersionCommand creates a command for displaying the version of this binary
-func NewVersionCommand(basename string) *cobra.Command {
+func NewVersionCommand(basename string, printEtcdVersion bool) *cobra.Command {
return &cobra.Command{
Use: "version",
Short: "Display version",
Run: func(c *cobra.Command, args []string) {
fmt.Printf("%s %v\n", basename, Get())
fmt.Printf("kubernetes %v\n", kubeversion.Get())
+ if printEtcdVersion {
+ fmt.Printf("etcd %v\n", etcdversion.Version)
+ }
},
}
}
