diff --git a/cmd/cert.go b/cmd/cert.go index ccf71999..6f27c460 100644 --- a/cmd/cert.go +++ b/cmd/cert.go @@ -4,6 +4,8 @@ import ( "context" "fmt" + "github.com/sirupsen/logrus" + "github.com/rancher/rke/cluster" "github.com/rancher/rke/hosts" "github.com/rancher/rke/log" @@ -71,6 +73,7 @@ func CertificateCommand() cli.Command { } func rotateRKECertificatesFromCli(ctx *cli.Context) error { + logrus.Infof("Running RKE version: %v", ctx.App.Version) k8sComponents := ctx.StringSlice("service") rotateCACerts := ctx.Bool("rotate-ca") clusterFile, filePath, err := resolveClusterFile(ctx) @@ -101,6 +104,7 @@ func rotateRKECertificatesFromCli(ctx *cli.Context) error { } func generateCSRFromCli(ctx *cli.Context) error { + logrus.Infof("Running RKE version: %v", ctx.App.Version) clusterFile, filePath, err := resolveClusterFile(ctx) if err != nil { return fmt.Errorf("Failed to resolve cluster file: %v", err) diff --git a/cmd/etcd.go b/cmd/etcd.go index 07659c70..ffbe3b5c 100644 --- a/cmd/etcd.go +++ b/cmd/etcd.go @@ -179,6 +179,7 @@ func RestoreEtcdSnapshot( } func SnapshotSaveEtcdHostsFromCli(ctx *cli.Context) error { + logrus.Infof("Running RKE version: %v", ctx.App.Version) clusterFile, filePath, err := resolveClusterFile(ctx) if err != nil { return fmt.Errorf("failed to resolve cluster file: %v", err) @@ -206,6 +207,7 @@ func SnapshotSaveEtcdHostsFromCli(ctx *cli.Context) error { } func RestoreEtcdSnapshotFromCli(ctx *cli.Context) error { + logrus.Infof("Running RKE version: %v", ctx.App.Version) clusterFile, filePath, err := resolveClusterFile(ctx) if err != nil { return fmt.Errorf("failed to resolve cluster file: %v", err) diff --git a/cmd/remove.go b/cmd/remove.go index e08166eb..208efab1 100644 --- a/cmd/remove.go +++ b/cmd/remove.go @@ -12,7 +12,7 @@ import ( "github.com/rancher/rke/hosts" "github.com/rancher/rke/log" "github.com/rancher/rke/pki" - "github.com/rancher/types/apis/management.cattle.io/v3" + v3 "github.com/rancher/types/apis/management.cattle.io/v3" "github.com/sirupsen/logrus" "github.com/urfave/cli" ) @@ -81,6 +81,7 @@ func ClusterRemove( } func clusterRemoveFromCli(ctx *cli.Context) error { + logrus.Infof("Running RKE version: %v", ctx.App.Version) if ctx.Bool("local") { return clusterRemoveLocal(ctx) } diff --git a/cmd/up.go b/cmd/up.go index 37b21342..e93f048a 100644 --- a/cmd/up.go +++ b/cmd/up.go @@ -6,6 +6,8 @@ import ( "strings" "time" + "github.com/sirupsen/logrus" + "github.com/rancher/rke/cluster" "github.com/rancher/rke/dind" "github.com/rancher/rke/hosts" @@ -205,6 +207,7 @@ func checkAllIncluded(cluster *cluster.Cluster) error { } func clusterUpFromCli(ctx *cli.Context) error { + logrus.Infof("Running RKE version: %v", ctx.App.Version) if ctx.Bool("local") { return clusterUpLocal(ctx) } diff --git a/cmd/version.go b/cmd/version.go index 09e80f39..c93c2253 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -3,6 +3,8 @@ package cmd import ( "fmt" + "github.com/sirupsen/logrus" + "github.com/rancher/rke/cluster" "github.com/rancher/rke/pki" "github.com/urfave/cli" @@ -26,6 +28,7 @@ func VersionCommand() cli.Command { } func getClusterVersion(ctx *cli.Context) error { + logrus.Infof("Running RKE version: %v", ctx.App.Version) localKubeConfig := pki.GetLocalKubeConfig(ctx.String("config"), "") // not going to use a k8s dialer here.. this is a CLI command serverVersion, err := cluster.GetK8sVersion(localKubeConfig, nil)