devlopment branch (#1736)

This commit is contained in:
zryfish
2020-01-02 20:52:00 +08:00
committed by GitHub
parent ff0ffe8650
commit eceadec69c
440 changed files with 61524 additions and 3699 deletions

View File

@@ -69,8 +69,10 @@ func NewControllerManagerCommand() *cobra.Command {
},
}
conf := loadConfFromFile()
fs := cmd.Flags()
namedFlagSets := s.Flags()
namedFlagSets := s.Flags(conf)
for _, f := range namedFlagSets.FlagSets {
fs.AddFlagSet(f)
@@ -119,6 +121,22 @@ func CreateClientSet(conf *controllerconfig.Config, stopCh <-chan struct{}) erro
return nil
}
func loadConfFromFile() *options.KubeSphereControllerManagerOptions {
err := controllerconfig.Load()
if err != nil {
klog.Fatalf("error happened while loading config file")
}
conf := controllerconfig.Get()
return &options.KubeSphereControllerManagerOptions{
KubernetesOptions: conf.KubernetesOptions,
DevopsOptions: conf.DevopsOptions,
S3Options: conf.S3Options,
OpenPitrixOptions: conf.OpenPitrixOptions,
}
}
func Run(s *options.KubeSphereControllerManagerOptions, stopCh <-chan struct{}) error {
err := CreateClientSet(controllerconfig.Get(), stopCh)
if err != nil {