1
0
mirror of https://github.com/rancher/steve.git synced 2025-09-27 15:53:59 +00:00

Add default api-server option

Issue: https://github.com/rancher/steve/pull/14
Refference: https://github.com/rancher/steve/pull/14/commits
This commit is contained in:
michelia
2021-06-21 15:10:56 +08:00
parent fee7384756
commit a56756d73e
4 changed files with 17 additions and 4 deletions

View File

@@ -16,15 +16,19 @@ import (
"k8s.io/client-go/rest"
)
func New(cfg *rest.Config, sf schema.Factory, authMiddleware auth.Middleware, next http.Handler, routerFunc router.RouterFunc) (http.Handler, error) {
func New(cfg *rest.Config, sf schema.Factory, authMiddleware auth.Middleware, next http.Handler, routerFunc router.RouterFunc, schemaServer *server.Server) (http.Handler, error) {
var (
proxy http.Handler
err error
)
if schemaServer == nil {
schemaServer = server.DefaultAPIServer()
}
a := &apiServer{
sf: sf,
server: server.DefaultAPIServer(),
server: schemaServer,
}
a.server.AccessControl = accesscontrol.NewAccessControl()