From 01179963cec3cecc417e1329ce28a112b0995f4c Mon Sep 17 00:00:00 2001 From: Liz Rice Date: Thu, 11 Apr 2019 17:05:57 +0100 Subject: [PATCH] Don't assume master if 0 master binaries specified --- cmd/common.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/common.go b/cmd/common.go index 9e29ede..2d6463c 100644 --- a/cmd/common.go +++ b/cmd/common.go @@ -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 }