add openpitrix Client to apiserver

This commit is contained in:
LiHui
2022-05-20 14:44:23 +08:00
parent 32b85cd625
commit 35027a346b
19 changed files with 100 additions and 127 deletions

View File

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