1
0
mirror of https://github.com/aquasecurity/kube-bench.git synced 2024-11-22 16:18:07 +00:00

Only get runningVersion if --version has not been provided

Signed-off-by: Weston Steimel <weston.steimel@gmail.com>
This commit is contained in:
Weston Steimel 2019-01-24 00:10:27 +00:00 committed by Abubakr-Sadik Nii Nai Davis
parent f2062e81a1
commit 42ed8628de

View File

@ -44,9 +44,12 @@ func runChecks(nodetype check.NodeType) {
file = federatedFile file = federatedFile
} }
runningVersion, err := getKubeVersion() runningVersion := ""
if err != nil && kubeVersion == "" { if kubeVersion == "" {
exitWithError(fmt.Errorf("Version check failed: %s\nAlternatively, you can specify the version with --version", err)) 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) path, err := getConfigFilePath(kubeVersion, runningVersion, file)
if err != nil { if err != nil {