Skip to content

Commit

Permalink
Merge pull request kubernetes#716 from yugui/fix/machines-flag
Browse files Browse the repository at this point in the history
Allow omitting -machines flag in apiserver
  • Loading branch information
smarterclayton committed Jul 31, 2014
2 parents 6af0717 + c65ac62 commit 2dc94e4
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions cmd/apiserver/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 2dc94e4

Please sign in to comment.