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

@@ -19,7 +19,6 @@ limitations under the License.
package integration
import (
"net/http"
"net/http/httptest"
"reflect"
"testing"
@@ -40,17 +39,14 @@ func TestClient(t *testing.T) {
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
mux := http.NewServeMux()
master.New(&master.Config{
m := master.New(&master.Config{
EtcdHelper: helper,
Mux: mux,
EnableLogsSupport: false,
EnableUISupport: false,
APIPrefix: "/api",
})
s := httptest.NewServer(mux)
s := httptest.NewServer(m.Handler)
testCases := []string{
"v1beta1",