Integration test on master, not just apiserver.
Moved code from cmd/apiserver to pkg/master. test/integration/client_test made to use a master object, instead of an apiserver.Handle. Subsequent PRs will move more handler-installation into pkg/master, with the goal that every http.Handler of a standalone apiserver process can also be tested in a "testing"-style go test. In particular, a subsequent PR will test authorization.
This commit is contained in:
@@ -38,7 +38,6 @@ import (
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/master"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/resources"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/tools"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/ui"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/version/verflag"
|
||||
|
||||
@@ -188,7 +187,8 @@ func main() {
|
||||
}
|
||||
|
||||
n := net.IPNet(portalNet)
|
||||
m := master.New(&master.Config{
|
||||
mux := http.NewServeMux()
|
||||
master.New(&master.Config{
|
||||
Client: client,
|
||||
Cloud: cloud,
|
||||
EtcdHelper: helper,
|
||||
@@ -204,18 +204,13 @@ func main() {
|
||||
resources.Memory: util.NewIntOrStringFromInt(*nodeMemory),
|
||||
},
|
||||
},
|
||||
PortalNet: &n,
|
||||
PortalNet: &n,
|
||||
Mux: mux,
|
||||
EnableLogsSupport: *enableLogsSupport,
|
||||
EnableUISupport: true,
|
||||
APIPrefix: *apiPrefix,
|
||||
})
|
||||
|
||||
mux := http.NewServeMux()
|
||||
apiserver.NewAPIGroup(m.API_v1beta1()).InstallREST(mux, *apiPrefix+"/v1beta1")
|
||||
apiserver.NewAPIGroup(m.API_v1beta2()).InstallREST(mux, *apiPrefix+"/v1beta2")
|
||||
apiserver.InstallSupport(mux)
|
||||
if *enableLogsSupport {
|
||||
apiserver.InstallLogsSupport(mux)
|
||||
}
|
||||
ui.InstallSupport(mux)
|
||||
|
||||
handler := http.Handler(mux)
|
||||
|
||||
if len(corsAllowedOriginList) > 0 {
|
||||
|
||||
Reference in New Issue
Block a user