From 42ed8628de2b60ce7b11ae37d59ad7b3db6b93ae Mon Sep 17 00:00:00 2001
From: Weston Steimel <weston.steimel@gmail.com>
Date: Thu, 24 Jan 2019 00:10:27 +0000
Subject: [PATCH] Only get runningVersion if --version has not been provided

Signed-off-by: Weston Steimel <weston.steimel@gmail.com>
---
 cmd/common.go | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/cmd/common.go b/cmd/common.go
index 2596114..e038efe 100644
--- a/cmd/common.go
+++ b/cmd/common.go
@@ -44,9 +44,12 @@ func runChecks(nodetype check.NodeType) {
 		file = federatedFile
 	}
 
-	runningVersion, err := getKubeVersion()
-	if err != nil && kubeVersion == "" {
-		exitWithError(fmt.Errorf("Version check failed: %s\nAlternatively, you can specify the version with --version", err))
+	runningVersion := ""
+	if kubeVersion == "" {
+		runningVersion, err = getKubeVersion()
+		if err != nil {
+			exitWithError(fmt.Errorf("Version check failed: %s\nAlternatively, you can specify the version with --version", err))
+		}
 	}
 	path, err := getConfigFilePath(kubeVersion, runningVersion, file)
 	if err != nil {
-- 
GitLab