fix controller manager bug

This commit is contained in:
Jeff
2019-10-11 20:58:49 +08:00
committed by zryfish
parent 466fd56262
commit 3f5cbcd4f9

View File

@@ -98,20 +98,21 @@ func Complete(s *options.KubeSphereControllerManagerOptions) *options.KubeSphere
return out return out
} }
func CreateClientSet(s *options.KubeSphereControllerManagerOptions, stopCh <-chan struct{}) error { func CreateClientSet(conf *controllerconfig.Config, stopCh <-chan struct{}) error {
csop := &client.ClientSetOptions{} csop := &client.ClientSetOptions{}
csop.SetKubernetesOptions(s.KubernetesOptions). csop.SetKubernetesOptions(conf.KubernetesOptions).
SetDevopsOptions(s.DevopsOptions). SetDevopsOptions(conf.DevopsOptions).
SetS3Options(s.S3Options). SetS3Options(conf.S3Options).
SetOpenPitrixOptions(s.OpenPitrixOptions) SetOpenPitrixOptions(conf.OpenPitrixOptions).
SetKubeSphereOptions(conf.KubeSphereOptions)
client.NewClientSetFactory(csop, stopCh) client.NewClientSetFactory(csop, stopCh)
return nil return nil
} }
func Run(s *options.KubeSphereControllerManagerOptions, stopCh <-chan struct{}) error { func Run(s *options.KubeSphereControllerManagerOptions, stopCh <-chan struct{}) error {
err := CreateClientSet(s, stopCh) err := CreateClientSet(controllerconfig.Get(), stopCh)
if err != nil { if err != nil {
klog.Error(err) klog.Error(err)
return err return err