add controllers
change kiali mux to go-restful add knative
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user