mirror of
https://github.com/aquasecurity/kube-bench.git
synced 2024-11-15 20:39:08 +00:00
Merge pull request #123 from Tenzer/add-info-about-version-flag
Add tip about the `--version` flag to error output
This commit is contained in:
commit
9f5c856206
@ -219,7 +219,7 @@ func getKubeVersion() string {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
_, err = exec.LookPath("kubelet")
|
_, err = exec.LookPath("kubelet")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
exitWithError(fmt.Errorf("Version check failed: need kubectl or kubelet binaries to get kubernetes version"))
|
exitWithError(fmt.Errorf("Version check failed: need kubectl or kubelet binaries to get kubernetes version.\nAlternately, you can specify the version with --version"))
|
||||||
}
|
}
|
||||||
return getKubeVersionFromKubelet()
|
return getKubeVersionFromKubelet()
|
||||||
}
|
}
|
||||||
@ -240,7 +240,7 @@ func getKubeVersionFromKubectl() string {
|
|||||||
func getKubeVersionFromKubelet() string {
|
func getKubeVersionFromKubelet() string {
|
||||||
cmd := exec.Command("kubelet", "--version")
|
cmd := exec.Command("kubelet", "--version")
|
||||||
out, err := cmd.CombinedOutput()
|
out, err := cmd.CombinedOutput()
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
continueWithError(fmt.Errorf("%s", out), "")
|
continueWithError(fmt.Errorf("%s", out), "")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user