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
}
func CreateClientSet(s *options.KubeSphereControllerManagerOptions, stopCh <-chan struct{}) error {
func CreateClientSet(conf *controllerconfig.Config, stopCh <-chan struct{}) error {
csop := &client.ClientSetOptions{}
csop.SetKubernetesOptions(s.KubernetesOptions).
SetDevopsOptions(s.DevopsOptions).
SetS3Options(s.S3Options).
SetOpenPitrixOptions(s.OpenPitrixOptions)
csop.SetKubernetesOptions(conf.KubernetesOptions).
SetDevopsOptions(conf.DevopsOptions).
SetS3Options(conf.S3Options).
SetOpenPitrixOptions(conf.OpenPitrixOptions).
SetKubeSphereOptions(conf.KubeSphereOptions)
client.NewClientSetFactory(csop, stopCh)
return nil
}
func Run(s *options.KubeSphereControllerManagerOptions, stopCh <-chan struct{}) error {
err := CreateClientSet(s, stopCh)
err := CreateClientSet(controllerconfig.Get(), stopCh)
if err != nil {
klog.Error(err)
return err