1
0
mirror of https://github.com/rancher/steve.git synced 2025-09-03 16:35:25 +00:00

Add k8s proxy

This commit is contained in:
Darren Shepherd
2019-08-07 22:41:31 -07:00
parent 24e6192504
commit 71faff9d2a
4 changed files with 134 additions and 6 deletions

View File

@@ -3,16 +3,15 @@ package server
import (
"net/http"
"github.com/rancher/naok/pkg/attributes"
"github.com/gorilla/mux"
"github.com/rancher/naok/pkg/attributes"
"github.com/rancher/norman/pkg/types"
"k8s.io/apimachinery/pkg/runtime/schema"
)
type APIFunc func(*types.APIRequest)
func (a *apiServer) routes() {
func (a *apiServer) routes() error {
a.Path("/v1/{type:schemas}").Handler(a.handle(nil))
a.Path("/v1/{type:schemas}/{name}").Handler(a.handle(nil))
a.Path("/v1/{type:subscribe}").Handler(a.handle(nil))
@@ -23,6 +22,8 @@ func (a *apiServer) routes() {
a.Path("/v1/apis/{group}/{version}/{resource}").Handler(a.handle(a.k8sAPI))
a.Path("/v1/apis/{group}/{version}/{resource}/{nameorns}").Handler(a.handle(a.k8sAPI))
return nil
}
func (a *apiServer) handle(apiFunc APIFunc) http.Handler {