Fix kubesphere_app_template_count always be 0 when GetKubeSphereStats

Signed-off-by: x893675 <x893675@icloud.com>
This commit is contained in:
x893675
2021-06-10 17:46:50 +08:00
committed by ks-ci-bot
parent 418a2a09c7
commit f29a5488a8
9 changed files with 35 additions and 15 deletions

View File

@@ -20,6 +20,8 @@ package v1alpha3
import (
"net/http"
openpitrixoptions "kubesphere.io/kubesphere/pkg/simple/client/openpitrix"
"kubesphere.io/kubesphere/pkg/client/clientset/versioned"
"github.com/emicklei/go-restful"
@@ -41,10 +43,10 @@ const (
var GroupVersion = schema.GroupVersion{Group: groupName, Version: "v1alpha3"}
func AddToContainer(c *restful.Container, k8sClient kubernetes.Interface, monitoringClient monitoring.Interface, metricsClient monitoring.Interface, factory informers.InformerFactory, ksClient versioned.Interface) error {
func AddToContainer(c *restful.Container, k8sClient kubernetes.Interface, monitoringClient monitoring.Interface, metricsClient monitoring.Interface, factory informers.InformerFactory, ksClient versioned.Interface, opOptions *openpitrixoptions.Options) error {
ws := runtime.NewWebService(GroupVersion)
h := NewHandler(k8sClient, monitoringClient, metricsClient, factory, ksClient, nil, nil)
h := NewHandler(k8sClient, monitoringClient, metricsClient, factory, ksClient, nil, nil, opOptions)
ws.Route(ws.GET("/kubesphere").
To(h.handleKubeSphereMetricsQuery).