Allow omitting -machines flag in apiserver when -cloud_provider and

-minion_regexp are specified because it is eventually overwritten by
-minion_regexp.
pull/6/head
Yuki Yugui Sonoda 2014-07-31 14:38:54 +09:00
parent 6af0717205
commit c65ac62cdd
1 changed files with 13 additions and 4 deletions

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 {