devlopment branch (#1736)
This commit is contained in:
@@ -2,7 +2,7 @@ package servicemesh
|
||||
|
||||
import "github.com/spf13/pflag"
|
||||
|
||||
type ServiceMeshOptions struct {
|
||||
type Options struct {
|
||||
|
||||
// istio pilot discovery service url
|
||||
IstioPilotHost string `json:"istioPilotHost,omitempty" yaml:"istioPilotHost"`
|
||||
@@ -15,21 +15,21 @@ type ServiceMeshOptions struct {
|
||||
}
|
||||
|
||||
// NewServiceMeshOptions returns a `zero` instance
|
||||
func NewServiceMeshOptions() *ServiceMeshOptions {
|
||||
return &ServiceMeshOptions{
|
||||
func NewServiceMeshOptions() *Options {
|
||||
return &Options{
|
||||
IstioPilotHost: "",
|
||||
JaegerQueryHost: "",
|
||||
ServicemeshPrometheusHost: "",
|
||||
}
|
||||
}
|
||||
|
||||
func (s *ServiceMeshOptions) Validate() []error {
|
||||
func (s *Options) Validate() []error {
|
||||
errors := []error{}
|
||||
|
||||
return errors
|
||||
}
|
||||
|
||||
func (s *ServiceMeshOptions) ApplyTo(options *ServiceMeshOptions) {
|
||||
func (s *Options) ApplyTo(options *Options) {
|
||||
if s.ServicemeshPrometheusHost != "" {
|
||||
options.ServicemeshPrometheusHost = s.ServicemeshPrometheusHost
|
||||
}
|
||||
@@ -43,13 +43,13 @@ func (s *ServiceMeshOptions) ApplyTo(options *ServiceMeshOptions) {
|
||||
}
|
||||
}
|
||||
|
||||
func (s *ServiceMeshOptions) AddFlags(fs *pflag.FlagSet) {
|
||||
fs.StringVar(&s.IstioPilotHost, "istio-pilot-host", s.IstioPilotHost, ""+
|
||||
func (s *Options) AddFlags(fs *pflag.FlagSet, c *Options) {
|
||||
fs.StringVar(&s.IstioPilotHost, "istio-pilot-host", c.IstioPilotHost, ""+
|
||||
"istio pilot discovery service url")
|
||||
|
||||
fs.StringVar(&s.JaegerQueryHost, "jaeger-query-host", s.JaegerQueryHost, ""+
|
||||
fs.StringVar(&s.JaegerQueryHost, "jaeger-query-host", c.JaegerQueryHost, ""+
|
||||
"jaeger query service url")
|
||||
|
||||
fs.StringVar(&s.ServicemeshPrometheusHost, "servicemesh-prometheus-host", s.ServicemeshPrometheusHost, ""+
|
||||
fs.StringVar(&s.ServicemeshPrometheusHost, "servicemesh-prometheus-host", c.ServicemeshPrometheusHost, ""+
|
||||
"prometheus service for servicemesh")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user