options.go 592 字节
Newer Older
Z
zryfish 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
package multicluster

import "github.com/spf13/pflag"

type Options struct {
	// Enable
	Enable           bool `json:"enable"`
	EnableFederation bool `json:"enableFederation,omitempty"`
}

// NewOptions() returns a default nil options
func NewOptions() *Options {
	return &Options{
		Enable:           false,
		EnableFederation: false,
	}
}

func (o *Options) Validate() []error {
	return nil
}

func (o *Options) AddFlags(fs *pflag.FlagSet, s *Options) {
	fs.BoolVar(&o.Enable, "multiple-clusters", s.Enable, ""+
		"This field instructs KubeSphere to enter multiple-cluster mode or not.")
}