Commit 2dc94e4a authored by Clayton Coleman's avatar Clayton Coleman

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

Allow omitting -machines flag in apiserver
parents 6af07172 c65ac62c
...@@ -50,16 +50,25 @@ func init() { ...@@ -50,16 +50,25 @@ func init() {
flag.Var(&machineList, "machines", "List of machines to schedule onto, comma separated.") 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() { func main() {
flag.Parse() flag.Parse()
util.InitLogs() util.InitLogs()
defer util.FlushLogs() defer util.FlushLogs()
version.PrintAndExitIfRequested() version.PrintAndExitIfRequested()
verifyMinionFlags()
if len(machineList) == 0 {
glog.Fatal("No machines specified!")
}
var cloud cloudprovider.Interface var cloud cloudprovider.Interface
switch *cloudProvider { switch *cloudProvider {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment