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

Don't assume master if 0 master binaries specified

This commit is contained in:
Liz Rice 2019-04-11 17:05:57 +01:00
parent 902a10f1c7
commit 596dae03d9
No known key found for this signature in database
GPG Key ID: 837476CA214296CB

View File

@ -202,9 +202,15 @@ func isMaster() bool {
_ = loadConfig(check.MASTER)
glog.V(2).Info("Checking if the current node is running master components")
masterConf := viper.Sub(string(check.MASTER))
if _, err := getBinaries(masterConf); err != nil {
components, err := getBinaries(masterConf)
if err != nil {
glog.V(2).Info(err)
return false
}
if len(components) == 0 {
glog.V(2).Info("No master binaries specified")
return false
}
return true
}