add more option comments

This commit is contained in:
Jeff
2019-09-12 15:21:47 +08:00
committed by zryfish
parent 66af315a85
commit 5dde737e6c
10 changed files with 98 additions and 41 deletions

View File

@@ -2,7 +2,6 @@ package prometheus
import (
"github.com/spf13/pflag"
"kubesphere.io/kubesphere/pkg/utils/reflectutils"
)
type PrometheusOptions struct {
@@ -24,7 +23,13 @@ func (s *PrometheusOptions) Validate() []error {
}
func (s *PrometheusOptions) ApplyTo(options *PrometheusOptions) {
reflectutils.Override(options, s)
if s.Endpoint != "" {
options.Endpoint = s.Endpoint
}
if s.SecondaryEndpoint != "" {
options.SecondaryEndpoint = s.SecondaryEndpoint
}
}
func (s *PrometheusOptions) AddFlags(fs *pflag.FlagSet) {