add cluster list api

Signed-off-by: Roland.Ma <rolandma@yunify.com>
This commit is contained in:
Roland.Ma
2021-09-06 03:14:32 +00:00
parent 638f0c9fa0
commit f5b98a39e5
4 changed files with 115 additions and 33 deletions

View File

@@ -23,6 +23,7 @@ import (
restfulspec "github.com/emicklei/go-restful-openapi"
"k8s.io/apimachinery/pkg/runtime/schema"
"kubesphere.io/api/gateway/v1alpha1"
"sigs.k8s.io/controller-runtime/pkg/cache"
"sigs.k8s.io/controller-runtime/pkg/client"
"kubesphere.io/kubesphere/pkg/api"
@@ -34,10 +35,10 @@ import (
var GroupVersion = schema.GroupVersion{Group: "gateway.kubesphere.io", Version: "v1alpha1"}
func AddToContainer(container *restful.Container, options *gateway.Options, client client.Client) error {
func AddToContainer(container *restful.Container, options *gateway.Options, cache cache.Cache, client client.Client) error {
ws := runtime.NewWebService(GroupVersion)
handler := newHandler(options, client)
handler := newHandler(options, cache, client)
// register gateway apis
ws.Route(ws.POST("/namespaces/{namespace}/gateways").