diff --git a/cmd/controller-manager/app/options/options.go b/cmd/controller-manager/app/options/options.go index e249a03bd..6fe6e919b 100644 --- a/cmd/controller-manager/app/options/options.go +++ b/cmd/controller-manager/app/options/options.go @@ -247,4 +247,6 @@ func (s *KubeSphereControllerManagerOptions) MergeConfig(cfg *controllerconfig.C s.MultiClusterOptions = cfg.MultiClusterOptions s.ServiceMeshOptions = cfg.ServiceMeshOptions s.GatewayOptions = cfg.GatewayOptions + s.MonitoringOptions = cfg.MonitoringOptions + s.AlertingOptions = cfg.AlertingOptions } diff --git a/cmd/ks-apiserver/app/options/options.go b/cmd/ks-apiserver/app/options/options.go index c73bdaa00..377fd5d19 100644 --- a/cmd/ks-apiserver/app/options/options.go +++ b/cmd/ks-apiserver/app/options/options.go @@ -20,6 +20,8 @@ import ( "crypto/tls" "flag" "fmt" + "net/http" + "strings" openpitrixv1 "kubesphere.io/kubesphere/pkg/kapis/openpitrix/v1" "kubesphere.io/kubesphere/pkg/utils/clusterclient" @@ -41,9 +43,6 @@ import ( auditingclient "kubesphere.io/kubesphere/pkg/simple/client/auditing/elasticsearch" "kubesphere.io/kubesphere/pkg/simple/client/cache" - "net/http" - "strings" - "kubesphere.io/kubesphere/pkg/simple/client/devops/jenkins" eventsclient "kubesphere.io/kubesphere/pkg/simple/client/events/elasticsearch" "kubesphere.io/kubesphere/pkg/simple/client/k8s" @@ -223,7 +222,7 @@ func (s *ServerRunOptions) NewAPIServer(stopCh <-chan struct{}) (*apiserver.APIS apiServer.ClusterClient = cc } - apiServer.OpenpitrixClient = openpitrixv1.NewOpenpitrixClient(informerFactory, apiServer.KubernetesClient.KubeSphere(), s.OpenPitrixOptions, apiServer.ClusterClient, stopCh) + apiServer.OpenpitrixClient = openpitrixv1.NewOpenpitrixClient(informerFactory, apiServer.KubernetesClient.KubeSphere(), s.OpenPitrixOptions, apiServer.ClusterClient) server := &http.Server{ Addr: fmt.Sprintf(":%d", s.GenericServerRunOptions.InsecurePort), diff --git a/pkg/kapis/openpitrix/v1/handler.go b/pkg/kapis/openpitrix/v1/handler.go index b6e1c30ea..ceb50895c 100644 --- a/pkg/kapis/openpitrix/v1/handler.go +++ b/pkg/kapis/openpitrix/v1/handler.go @@ -52,7 +52,7 @@ type openpitrixHandler struct { openpitrix openpitrix.Interface } -func NewOpenpitrixClient(ksInformers informers.InformerFactory, ksClient versioned.Interface, option *openpitrixoptions.Options, cc clusterclient.ClusterClients, stopCh <-chan struct{}) openpitrix.Interface { +func NewOpenpitrixClient(ksInformers informers.InformerFactory, ksClient versioned.Interface, option *openpitrixoptions.Options, cc clusterclient.ClusterClients) openpitrix.Interface { var s3Client s3.Interface if option != nil && option.S3Options != nil && len(option.S3Options.Endpoint) != 0 { var err error @@ -62,7 +62,7 @@ func NewOpenpitrixClient(ksInformers informers.InformerFactory, ksClient version } } - return openpitrix.NewOpenpitrixOperator(ksInformers, ksClient, s3Client, cc, stopCh) + return openpitrix.NewOpenpitrixOperator(ksInformers, ksClient, s3Client, cc) } func (h *openpitrixHandler) CreateRepo(req *restful.Request, resp *restful.Response) { diff --git a/pkg/models/openpitrix/interface.go b/pkg/models/openpitrix/interface.go index a0613f5a8..c978afcc0 100644 --- a/pkg/models/openpitrix/interface.go +++ b/pkg/models/openpitrix/interface.go @@ -46,7 +46,7 @@ type openpitrixOperator struct { CategoryInterface } -func NewOpenpitrixOperator(ksInformers ks_informers.InformerFactory, ksClient versioned.Interface, s3Client s3.Interface, cc clusterclient.ClusterClients, stopCh <-chan struct{}) Interface { +func NewOpenpitrixOperator(ksInformers ks_informers.InformerFactory, ksClient versioned.Interface, s3Client s3.Interface, cc clusterclient.ClusterClients) Interface { klog.Infof("start helm repo informer") cachedReposData := reposcache.NewReposCache() helmReposInformer := ksInformers.KubeSphereSharedInformerFactory().Application().V1alpha1().HelmRepos().Informer() diff --git a/pkg/simple/client/ldap/ldap.go b/pkg/simple/client/ldap/ldap.go index 8daadc3d5..b68f42870 100644 --- a/pkg/simple/client/ldap/ldap.go +++ b/pkg/simple/client/ldap/ldap.go @@ -20,7 +20,6 @@ import ( "fmt" "sort" "strings" - "sync" "time" "github.com/go-ldap/ldap" @@ -59,8 +58,6 @@ type ldapInterfaceImpl struct { groupSearchBase string managerDN string managerPassword string - - once sync.Once } var _ Interface = &ldapInterfaceImpl{} @@ -91,7 +88,6 @@ func NewLdapClient(options *Options, stopCh <-chan struct{}) (Interface, error) groupSearchBase: options.GroupSearchBase, managerDN: options.ManagerDN, managerPassword: options.ManagerPassword, - once: sync.Once{}, } go func() { @@ -99,9 +95,7 @@ func NewLdapClient(options *Options, stopCh <-chan struct{}) (Interface, error) client.close() }() - client.once.Do(func() { - _ = client.createSearchBase() - }) + _ = client.createSearchBase() return client, nil }