fix hypersphere apis installation

This commit is contained in:
Jeff
2019-09-27 18:18:59 +08:00
committed by zryfish
parent 106354819e
commit 69ab71d629
10 changed files with 69 additions and 38 deletions

View File

@@ -25,13 +25,6 @@ import (
"github.com/mholt/caddy/caddyhttp/httpserver"
)
func init() {
caddy.RegisterPlugin("authenticate", caddy.Plugin{
ServerType: "http",
Action: Setup,
})
}
func Setup(c *caddy.Controller) error {
rule, err := parse(c)

View File

@@ -27,13 +27,6 @@ import (
"kubesphere.io/kubesphere/pkg/informers"
)
func init() {
caddy.RegisterPlugin("authentication", caddy.Plugin{
ServerType: "http",
Action: Setup,
})
}
// Setup is called by Caddy to parse the config block
func Setup(c *caddy.Controller) error {

View File

@@ -25,13 +25,6 @@ import (
"github.com/mholt/caddy/caddyhttp/httpserver"
)
func init() {
caddy.RegisterPlugin("swagger", caddy.Plugin{
ServerType: "http",
Action: Setup,
})
}
func Setup(c *caddy.Controller) error {
handler, err := parse(c)

26
pkg/apigateway/plugins.go Normal file
View File

@@ -0,0 +1,26 @@
package apigateway
import (
"github.com/mholt/caddy"
"kubesphere.io/kubesphere/pkg/apigateway/caddy-plugin/authenticate"
"kubesphere.io/kubesphere/pkg/apigateway/caddy-plugin/authentication"
swagger "kubesphere.io/kubesphere/pkg/apigateway/caddy-plugin/swagger"
)
func RegisterPlugins() {
caddy.RegisterPlugin("swagger", caddy.Plugin{
ServerType: "http",
Action: swagger.Setup,
})
caddy.RegisterPlugin("authenticate", caddy.Plugin{
ServerType: "http",
Action: authenticate.Setup,
})
caddy.RegisterPlugin("authentication", caddy.Plugin{
ServerType: "http",
Action: authentication.Setup,
})
}

32
pkg/apis/kapis.go Normal file
View File

@@ -0,0 +1,32 @@
package apis
import (
"github.com/emicklei/go-restful"
urlruntime "k8s.io/apimachinery/pkg/util/runtime"
devopsv1alpha2 "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha2"
iamv1alpha2 "kubesphere.io/kubesphere/pkg/apis/iam/v1alpha2"
loggingv1alpha2 "kubesphere.io/kubesphere/pkg/apis/logging/v1alpha2"
monitoringv1alpha2 "kubesphere.io/kubesphere/pkg/apis/monitoring/v1alpha2"
openpitrixv1 "kubesphere.io/kubesphere/pkg/apis/openpitrix/v1"
operationsv1alpha2 "kubesphere.io/kubesphere/pkg/apis/operations/v1alpha2"
resourcesv1alpha2 "kubesphere.io/kubesphere/pkg/apis/resources/v1alpha2"
servicemeshv1alpha2 "kubesphere.io/kubesphere/pkg/apis/servicemesh/metrics/v1alpha2"
tenantv1alpha2 "kubesphere.io/kubesphere/pkg/apis/tenant/v1alpha2"
terminalv1alpha2 "kubesphere.io/kubesphere/pkg/apis/terminal/v1alpha2"
)
func InstallAPIs(container *restful.Container) {
urlruntime.Must(servicemeshv1alpha2.AddToContainer(container))
urlruntime.Must(devopsv1alpha2.AddToContainer(container))
urlruntime.Must(loggingv1alpha2.AddToContainer(container))
urlruntime.Must(monitoringv1alpha2.AddToContainer(container))
urlruntime.Must(openpitrixv1.AddToContainer(container))
urlruntime.Must(operationsv1alpha2.AddToContainer(container))
urlruntime.Must(resourcesv1alpha2.AddToContainer(container))
urlruntime.Must(tenantv1alpha2.AddToContainer(container))
urlruntime.Must(terminalv1alpha2.AddToContainer(container))
}
func InstallAuthorizationAPIs(container *restful.Container) {
urlruntime.Must(iamv1alpha2.AddToContainer(container))
}