Merge pull request #716 from yugui/fix/machines-flag

Allow omitting -machines flag in apiserver
This commit is contained in:
Clayton Coleman 2014-07-31 09:31:46 -04:00
commit 2dc94e4a6e

View File

@ -50,16 +50,25 @@ func init() {
flag.Var(&machineList, "machines", "List of machines to schedule onto, comma separated.")
}
func verifyMinionFlags() {
if *cloudProvider == "" || *minionRegexp == "" {
if len(machineList) == 0 {
glog.Fatal("No machines specified!")
}
return
}
if len(machineList) != 0 {
glog.Info("-machines is overwritten by -minion_regexp")
}
}
func main() {
flag.Parse()
util.InitLogs()
defer util.FlushLogs()
version.PrintAndExitIfRequested()
if len(machineList) == 0 {
glog.Fatal("No machines specified!")
}
verifyMinionFlags()
var cloud cloudprovider.Interface
switch *cloudProvider {