fix servicemesh options nil bug

This commit is contained in:
Jeff
2019-09-25 01:16:13 +08:00
committed by zryfish
parent 284c0d6425
commit d0dc66cf28
16 changed files with 48 additions and 105 deletions

View File

@@ -5,8 +5,8 @@ import (
)
type PrometheusOptions struct {
Endpoint string `json:"endpoint,omitempty" yaml:"endpoint,omitempty"`
SecondaryEndpoint string `json:"secondaryEndpoint,omitempty" yaml:"secondaryEndpoint,omitempty"`
Endpoint string `json:"endpoint,omitempty" yaml:"endpoint"`
SecondaryEndpoint string `json:"secondaryEndpoint,omitempty" yaml:"secondaryEndpoint"`
}
func NewPrometheusOptions() *PrometheusOptions {
@@ -23,11 +23,6 @@ func (s *PrometheusOptions) Validate() []error {
}
func (s *PrometheusOptions) ApplyTo(options *PrometheusOptions) {
if options == nil {
options = s
return
}
if s.Endpoint != "" {
options.Endpoint = s.Endpoint
}