Only get runningVersion if --version has not been provided

Signed-off-by: Weston Steimel <weston.steimel@gmail.com>
pull/212/head
Weston Steimel 5 years ago committed by Abubakr-Sadik Nii Nai Davis
parent f2062e81a1
commit 42ed8628de

@ -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 {

Loading…
Cancel
Save