Allocate mux in master.New()

Callsites no longer allocate a mux.
Master now exposes method to install handlers
which use the master's auth code.  Not used
but forks (openshift) are expected to use these
methods.  These methods will later be a point
for additional plug-in functionality.
Integration tests now use the master-provided
handler which has auth, rather than using the mux,
which didn't.  Fix TestWhoAmI now that /_whoami
sits behind auth.
This commit is contained in:
Eric Tune
2014-10-28 13:02:19 -07:00
parent ecdf65f4b1
commit 9713b58caa
5 changed files with 65 additions and 28 deletions

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}