Merge pull request #2044 from erictune/fix_mux

Allocate mux in master.New()
This commit is contained in:
Clayton Coleman
2014-10-30 20:15:57 -04:00
5 changed files with 65 additions and 28 deletions

View File

@@ -197,7 +197,6 @@ func main() {
}
n := net.IPNet(portalNet)
mux := http.NewServeMux()
config := &master.Config{
Client: client,
Cloud: cloud,
@@ -215,7 +214,6 @@ func main() {
},
},
PortalNet: &n,
Mux: mux,
EnableLogsSupport: *enableLogsSupport,
EnableUISupport: true,
APIPrefix: *apiPrefix,

View File

@@ -137,14 +137,12 @@ func startComponents(manifestURL string) (apiServerURL string) {
if err != nil {
glog.Fatalf("Nonnumeric port? %v", err)
}
mux := http.NewServeMux()
// Create a master and install handlers into mux.
master.New(&master.Config{
m := master.New(&master.Config{
Client: cl,
EtcdHelper: helper,
Minions: machineList,
KubeletClient: fakeKubeletClient{},
Mux: mux,
EnableLogsSupport: false,
APIPrefix: "/api",
@@ -152,7 +150,7 @@ func startComponents(manifestURL string) (apiServerURL string) {
ReadOnlyPort: portNumber,
PublicAddress: host,
})
handler.delegate = mux
handler.delegate = m.Handler
// Scheduler
schedulerConfigFactory := &factory.ConfigFactory{cl}