fix hypersphere apis installation
This commit is contained in:
@@ -20,11 +20,6 @@ package main
|
||||
import (
|
||||
"kubesphere.io/kubesphere/cmd/ks-apigateway/app"
|
||||
"os"
|
||||
|
||||
// Install apis
|
||||
_ "kubesphere.io/kubesphere/pkg/apigateway/caddy-plugin/authenticate"
|
||||
_ "kubesphere.io/kubesphere/pkg/apigateway/caddy-plugin/authentication"
|
||||
_ "kubesphere.io/kubesphere/pkg/apigateway/caddy-plugin/swagger"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
@@ -8,6 +8,8 @@ import (
|
||||
apiserverconfig "kubesphere.io/kubesphere/pkg/server/config"
|
||||
"kubesphere.io/kubesphere/pkg/simple/client"
|
||||
"kubesphere.io/kubesphere/pkg/utils/signals"
|
||||
|
||||
"kubesphere.io/kubesphere/pkg/apigateway"
|
||||
)
|
||||
|
||||
func NewAPIGatewayCommand() *cobra.Command {
|
||||
@@ -25,6 +27,8 @@ Kubernetes API Server for KubeSphere authorization purpose.
|
||||
return err
|
||||
}
|
||||
|
||||
apigateway.RegisterPlugins()
|
||||
|
||||
return Run(signals.SetupSignalHandler())
|
||||
},
|
||||
}
|
||||
|
||||
@@ -37,16 +37,7 @@ import (
|
||||
"kubesphere.io/kubesphere/pkg/utils/term"
|
||||
"net/http"
|
||||
|
||||
// Install apis
|
||||
_ "kubesphere.io/kubesphere/pkg/apis/devops/install"
|
||||
_ "kubesphere.io/kubesphere/pkg/apis/logging/install"
|
||||
_ "kubesphere.io/kubesphere/pkg/apis/monitoring/install"
|
||||
_ "kubesphere.io/kubesphere/pkg/apis/openpitrix/install"
|
||||
_ "kubesphere.io/kubesphere/pkg/apis/operations/install"
|
||||
_ "kubesphere.io/kubesphere/pkg/apis/resources/install"
|
||||
_ "kubesphere.io/kubesphere/pkg/apis/servicemesh/metrics/install"
|
||||
_ "kubesphere.io/kubesphere/pkg/apis/tenant/install"
|
||||
_ "kubesphere.io/kubesphere/pkg/apis/terminal/install"
|
||||
"kubesphere.io/kubesphere/pkg/apis"
|
||||
)
|
||||
|
||||
func NewAPIServerCommand() *cobra.Command {
|
||||
@@ -143,6 +134,8 @@ func CreateAPIServer(s *options.ServerRunOptions) error {
|
||||
container.Filter(filter.Logging)
|
||||
container.RecoverHandler(server.LogStackOnRecover)
|
||||
|
||||
apis.InstallAPIs(container)
|
||||
|
||||
// install config api
|
||||
apiserverconfig.InstallAPI(container)
|
||||
|
||||
|
||||
@@ -20,8 +20,6 @@ package main
|
||||
import (
|
||||
"kubesphere.io/kubesphere/cmd/ks-iam/app"
|
||||
"log"
|
||||
// Install apis
|
||||
_ "kubesphere.io/kubesphere/pkg/apis/iam/install"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
@@ -36,6 +36,8 @@ import (
|
||||
"kubesphere.io/kubesphere/pkg/utils/term"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"kubesphere.io/kubesphere/pkg/apis"
|
||||
)
|
||||
|
||||
func NewAPIServerCommand() *cobra.Command {
|
||||
@@ -112,6 +114,8 @@ func Run(s *options.ServerRunOptions, stopChan <-chan struct{}) error {
|
||||
container.DoNotRecover(false)
|
||||
container.RecoverHandler(server.LogStackOnRecover)
|
||||
|
||||
apis.InstallAuthorizationAPIs(container)
|
||||
|
||||
if s.GenericServerRunOptions.InsecurePort != 0 {
|
||||
klog.Infof("Server listening on %s:%d ", s.GenericServerRunOptions.BindAddress, s.GenericServerRunOptions.InsecurePort)
|
||||
err = http.ListenAndServe(fmt.Sprintf("%s:%d", s.GenericServerRunOptions.BindAddress, s.GenericServerRunOptions.InsecurePort), container)
|
||||
|
||||
Reference in New Issue
Block a user