func NewCommandStartSampleAdapterServer(out, errOut io.Writer, stopCh <-chan struct{}) *cobra.Command {
	baseOpts := server.NewCustomMetricsAdapterServerOptions(out, errOut)
	o := sampleAdapterServerOptions{
		CustomMetricsAdapterServerOptions: baseOpts,
		DiscoveryInterval:                 10 * time.Minute,
		UseNewResourceModel:               false,
		EnableCustomMetricsAPI:            true,
		EnableExternalMetricsAPI:          true,
	}

	cmd := &cobra.Command{
		Short: "Launch the custom metrics API adapter server",
		Long:  "Launch the custom metrics API adapter server",
		RunE: func(c *cobra.Command, args []string) error {
			if err := o.Complete(); err != nil {
				return err
			}
			if err := o.Validate(args); err != nil {
				return err
			}
			err := o.RunCustomMetricsAdapterServer(stopCh)
			return err
		},
	}

	flags := cmd.Flags()
	o.SecureServing.AddFlags(flags)
	o.Authentication.AddFlags(flags)
	o.Authorization.AddFlags(flags)
	o.Features.AddFlags(flags)

	flags.StringVar(&o.RemoteKubeConfigFile, "lister-kubeconfig", o.RemoteKubeConfigFile, ""+
		"kubeconfig file pointing at the 'core' kubernetes server with enough rights to list "+
		"any described objets")
	flags.DurationVar(&o.DiscoveryInterval, "discovery-interval", o.DiscoveryInterval, ""+
		"interval at which to refresh API discovery information")
	flags.BoolVar(&o.UseNewResourceModel, "use-new-resource-model", o.UseNewResourceModel, ""+
		"whether to use new Stackdriver resource model")
	flags.BoolVar(&o.EnableCustomMetricsAPI, "enable-custom-metrics-api", o.EnableCustomMetricsAPI, ""+
		"whether to enable Custom Metrics API")
	flags.BoolVar(&o.EnableExternalMetricsAPI, "enable-external-metrics-api", o.EnableExternalMetricsAPI, ""+
		"whether to enable External Metrics API")

	return cmd
}
// NewCommandStartSampleAdapterServer provides a CLI handler for 'start master' command
NewCommandStartSampleAdapterServer provides a CLI handler for 'start master' command
// NewCommandStartSampleAdapterServer provides a CLI handler for ' start master ' command
func NewCommandStartSampleAdapterServer(out, errOut io.Writer, stopCh <-chan struct{}) *cobra.Command {
	baseOpts := server.NewCustomMetricsAdapterServerOptions(out, errOut)
	o := sampleAdapterServerOptions{
		CustomMetricsAdapterServerOptions: baseOpts,
		DiscoveryInterval:                 10 * time.Minute,
		UseNewResourceModel:               false,
		EnableCustomMetricsAPI:            true,
		EnableExternalMetricsAPI:          true,
	}
	cmd := &cobra.Command{
		Short: "Launch the custom metrics API adapter server",
		Long:  "Launch the custom metrics API adapter server",
		RunE: func(c *cobra.Command, args []string) error {
			if err := o.Complete(); err != nil {
				return err
			}
			if err := o.Validate(args); err != nil {
				return err
			}
			err := o.RunCustomMetricsAdapterServer(stopCh)
			return err
		},
	}
	flags := cmd.Flags()
	o.SecureServing.AddFlags(flags)
	o.Authentication.AddFlags(flags)
	o.Authorization.AddFlags(flags)
	o.Features.AddFlags(flags)
	flags.StringVar(&o.RemoteKubeConfigFile, "lister-kubeconfig", o.RemoteKubeConfigFile, ""+
		"kubeconfig file pointing at the 'core' kubernetes server with enough rights to list "+
		"any described objets")
	flags.DurationVar(&o.DiscoveryInterval, "discovery-interval", o.DiscoveryInterval, ""+
		"interval at which to refresh API discovery information")
	flags.BoolVar(&o.UseNewResourceModel, "use-new-resource-model", o.UseNewResourceModel, ""+
		"whether to use new Stackdriver resource model")
	flags.BoolVar(&o.EnableCustomMetricsAPI, "enable-custom-metrics-api", o.EnableCustomMetricsAPI, ""+
		"whether to enable Custom Metrics API")
	flags.BoolVar(&o.EnableExternalMetricsAPI, "enable-external-metrics-api", o.EnableExternalMetricsAPI, ""+
		"whether to enable External Metrics API")
	return cmd
}
func NewCommandStartSampleAdapterServer ( out , errOut io . Writer , stopCh <- chan struct { } ) * cobra . Command { baseOpts := server . NewCustomMetricsAdapterServerOptions ( out , errOut ) o := sampleAdapterServerOptions { CustomMetricsAdapterServerOptions : baseOpts , DiscoveryInterval : 10 * time . Minute , UseNewResourceModel : false , EnableCustomMetricsAPI : true , EnableExternalMetricsAPI : true , } cmd := & cobra . Command { Short : " " , Long : " " , RunE : func ( c * cobra . Command , args [ ] string ) error { if err := o . Complete ( ) ; err != nil { return err } if err := o . Validate ( args ) ; err != nil { return err } err := o . RunCustomMetricsAdapterServer ( stopCh ) return err } , } flags := cmd . Flags ( ) o . SecureServing . AddFlags ( flags ) o . Authentication . AddFlags ( flags ) o . Authorization . AddFlags ( flags ) o . Features . AddFlags ( flags ) flags . StringVar ( & o . RemoteKubeConfigFile , " " , o . RemoteKubeConfigFile , " " + " " + " " ) flags . DurationVar ( & o . DiscoveryInterval , " " , o . DiscoveryInterval , " " + " " ) flags . BoolVar ( & o . UseNewResourceModel , " " , o . UseNewResourceModel , " " + " " ) flags . BoolVar ( & o . EnableCustomMetricsAPI , " " , o . EnableCustomMetricsAPI , " " + " " ) flags . BoolVar ( & o . EnableExternalMetricsAPI , " " , o . EnableExternalMetricsAPI , " " + " " ) return cmd }
NewCommandStartSampleAdapterServer provides a CLI handler for 'start master' command
NewCommandStartSampleAdapterServer provides a CLI handler for ' start master ' command