add controllers

change kiali mux to go-restful

add knative
This commit is contained in:
Jeff
2019-03-20 11:12:40 +08:00
committed by zryfish
parent 4c7c837771
commit aa4d07c80a
241 changed files with 53767 additions and 749 deletions

View File

@@ -18,6 +18,7 @@
package prometheus
import (
"flag"
"io/ioutil"
"net/http"
"net/url"
@@ -25,8 +26,6 @@ import (
"strings"
"time"
"os"
"github.com/emicklei/go-restful"
"github.com/golang/glog"
)
@@ -46,10 +45,7 @@ var PrometheusAPIServer = "prometheus-k8s.kubesphere-monitoring-system.svc"
var PrometheusAPIEndpoint string
func init() {
if env := os.Getenv(PrometheusAPIServerEnv); env != "" {
PrometheusAPIServer = env
}
PrometheusAPIEndpoint = DefaultScheme + "://" + PrometheusAPIServer + ":" + DefaultPrometheusPort + PrometheusApiPath
flag.StringVar(&PrometheusAPIEndpoint, "prometheus-endpoint", "http://prometheus-k8s.kubesphere-monitoring-system.svc:9090/api/v1", "")
}
type MonitoringRequestParams struct {

View File

@@ -85,7 +85,7 @@ func NewNamespaceController(
return controller
}
func (c *NamespaceController) Start(stopCh <-chan struct{}) {
func (c *NamespaceController) Start(stopCh <-chan struct{}) error {
go func() {
defer utilruntime.HandleCrash()
defer c.workqueue.ShutDown()
@@ -109,6 +109,8 @@ func (c *NamespaceController) Start(stopCh <-chan struct{}) {
<-stopCh
glog.Info("shutting down workers")
}()
return nil
}
func (c *NamespaceController) runWorker() {