cluster clusters

This commit is contained in:
LiHui
2022-05-20 11:53:51 +08:00
parent 49cc977cf0
commit 32b85cd625
18 changed files with 81 additions and 65 deletions

View File

@@ -14,6 +14,7 @@ limitations under the License.
package v1
import (
"kubesphere.io/kubesphere/pkg/utils/clusterclient"
"net/http"
restful "github.com/emicklei/go-restful"
@@ -38,11 +39,11 @@ const (
var GroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"}
func AddToContainer(c *restful.Container, ksInfomrers informers.InformerFactory, ksClient versioned.Interface, options *openpitrixoptions.Options, stopCh <-chan struct{}) error {
func AddToContainer(c *restful.Container, ksInfomrers informers.InformerFactory, ksClient versioned.Interface, options *openpitrixoptions.Options, cc clusterclient.ClusterClients, stopCh <-chan struct{}) error {
mimePatch := []string{restful.MIME_JSON, runtime.MimeJsonPatchJson, runtime.MimeMergePatchJson}
webservice := runtime.NewWebService(GroupVersion)
handler := newOpenpitrixHandler(ksInfomrers, ksClient, options, stopCh)
handler := newOpenpitrixHandler(ksInfomrers, ksClient, options, cc, stopCh)
webservice.Route(webservice.POST("/repos").
To(handler.CreateRepo).