1. change glog to klog

2. move types to api package to avoid cyclic import
This commit is contained in:
Jeff
2019-09-16 12:46:53 +08:00
committed by zryfish
parent 79735c4543
commit 97c9a1786a
109 changed files with 1076 additions and 552 deletions

View File

@@ -1 +1,40 @@
package kubesphere
import "github.com/spf13/pflag"
type KubeSphereOptions struct {
APIServer string
AccountServer string
}
// NewKubeSphereOptions create a default options
func NewKubeSphereOptions() *KubeSphereOptions {
return &KubeSphereOptions{
APIServer: "http://ks-apiserver.kubesphere-system.svc",
AccountServer: "http://ks-account.kubesphere-system.svc",
}
}
func (s *KubeSphereOptions) ApplyTo(options *KubeSphereOptions) {
if s.AccountServer != "" {
options.AccountServer = s.AccountServer
}
if s.APIServer != "" {
options.APIServer = s.APIServer
}
}
func (s *KubeSphereOptions) Validate() []error {
errs := []error{}
return errs
}
func (s *KubeSphereOptions) AddFlags(fs *pflag.FlagSet) {
fs.StringVar(&s.APIServer, "kubesphere-apiserver-host", s.APIServer, ""+
"KubeSphere apiserver host address.")
fs.StringVar(&s.AccountServer, "kubesphere-account-host", s.AccountServer, ""+
"KubeSphere account server host address.")
}