diff --git a/pkg/apiserver/config/config.go b/pkg/apiserver/config/config.go index 9c4cd7892..d0f717e2e 100644 --- a/pkg/apiserver/config/config.go +++ b/pkg/apiserver/config/config.go @@ -186,8 +186,7 @@ func (conf *Config) stripEmptyOptions() { conf.DevopsOptions = nil } - if conf.MonitoringOptions != nil && conf.MonitoringOptions.Endpoint == "" && - conf.MonitoringOptions.SecondaryEndpoint == "" { + if conf.MonitoringOptions != nil && conf.MonitoringOptions.Endpoint == "" { conf.MonitoringOptions = nil } diff --git a/pkg/apiserver/config/config_test.go b/pkg/apiserver/config/config_test.go index 041a78359..a414a2b33 100644 --- a/pkg/apiserver/config/config_test.go +++ b/pkg/apiserver/config/config_test.go @@ -103,8 +103,7 @@ func newTestConfig() (*Config, error) { WeaveScopeHost: "weave-scope-app.weave.svc", }, MonitoringOptions: &prometheus.Options{ - Endpoint: "http://prometheus.kubesphere-monitoring-system.svc", - SecondaryEndpoint: "http://prometheus.kubesphere-monitoring-system.svc", + Endpoint: "http://prometheus.kubesphere-monitoring-system.svc", }, LoggingOptions: &elasticsearch.Options{ Host: "http://elasticsearch-logging.kubesphere-logging-system.svc:9200", diff --git a/pkg/simple/client/monitoring/prometheus/prometheus_options.go b/pkg/simple/client/monitoring/prometheus/prometheus_options.go index 8b46fbff5..1867e7a04 100644 --- a/pkg/simple/client/monitoring/prometheus/prometheus_options.go +++ b/pkg/simple/client/monitoring/prometheus/prometheus_options.go @@ -5,14 +5,12 @@ import ( ) type Options struct { - Endpoint string `json:"endpoint,omitempty" yaml:"endpoint"` - SecondaryEndpoint string `json:"secondaryEndpoint,omitempty" yaml:"secondaryEndpoint"` + Endpoint string `json:"endpoint,omitempty" yaml:"endpoint"` } func NewPrometheusOptions() *Options { return &Options{ - Endpoint: "", - SecondaryEndpoint: "", + Endpoint: "", } } @@ -25,17 +23,10 @@ func (s *Options) ApplyTo(options *Options) { if s.Endpoint != "" { options.Endpoint = s.Endpoint } - - if s.SecondaryEndpoint != "" { - options.SecondaryEndpoint = s.SecondaryEndpoint - } } func (s *Options) AddFlags(fs *pflag.FlagSet, c *Options) { fs.StringVar(&s.Endpoint, "prometheus-endpoint", c.Endpoint, ""+ "Prometheus service endpoint which stores KubeSphere monitoring data, if left "+ "blank, will use builtin metrics-server as data source.") - - fs.StringVar(&s.SecondaryEndpoint, "prometheus-secondary-endpoint", c.SecondaryEndpoint, ""+ - "Prometheus secondary service endpoint, if left empty and endpoint is set, will use endpoint instead.") }