Add master.Config type and cleanup master configuration

Setting up a new master.Master instance requires passing
around too many arguments.

Add a master.Config type and group related master configs.
Refactor all commands to instantiate new masters using a
master.Config struct.
This commit is contained in:
Kelsey Hightower
2014-07-26 19:16:39 -07:00
parent 8a5cc87df8
commit 6d1be5f0ee
3 changed files with 50 additions and 19 deletions

View File

@@ -95,7 +95,12 @@ func startComponents(manifestURL string) (apiServerURL string) {
cl.Sync = true
// Master
m := master.New(servers, machineList, fakePodInfoGetter{}, nil, "", cl, false, 0)
m := master.New(&master.Config{
Client: cl,
EtcdServers: servers,
Minions: machineList,
PodInfoGetter: fakePodInfoGetter{},
})
handler.delegate = m.ConstructHandler("/api/v1beta1")
controllerManager := controller.MakeReplicationManager(etcdClient, cl)