66 kcpcorev1alpha1 "github.com/kcp-dev/kcp/sdk/apis/core/v1alpha1"
77 platformeshconfig "github.com/platform-mesh/golang-commons/config"
88 "github.com/platform-mesh/golang-commons/controller/lifecycle/builder"
9- lifecyclecontrollerruntime "github.com/platform-mesh/golang-commons/controller/lifecycle/multicluster"
9+ "github.com/platform-mesh/golang-commons/controller/lifecycle/multicluster"
1010 lifecyclesubroutine "github.com/platform-mesh/golang-commons/controller/lifecycle/subroutine"
1111 "github.com/platform-mesh/golang-commons/logger"
1212 ctrl "sigs.k8s.io/controller-runtime"
@@ -23,18 +23,18 @@ import (
2323type LogicalClusterReconciler struct {
2424 log * logger.Logger
2525
26- lifecycle * lifecyclecontrollerruntime .LifecycleManager
26+ mclifecycle * multicluster .LifecycleManager
2727}
2828
2929func NewLogicalClusterReconciler (log * logger.Logger , orgClient client.Client , cfg config.Config , inClusterClient client.Client , mgr mcmanager.Manager ) * LogicalClusterReconciler {
3030 return & LogicalClusterReconciler {
3131 log : log ,
32- lifecycle : builder .NewBuilder ("logicalcluster" , "LogicalClusterReconciler" , []lifecyclesubroutine.Subroutine {
32+ mclifecycle : builder .NewBuilder ("logicalcluster" , "LogicalClusterReconciler" , []lifecyclesubroutine.Subroutine {
3333 subroutine .NewWorkspaceInitializer (orgClient , cfg , mgr ),
3434 subroutine .NewWorkspaceAuthConfigurationSubroutine (orgClient , inClusterClient , cfg ),
3535 subroutine .NewRealmSubroutine (inClusterClient , & cfg , cfg .BaseDomain ),
3636 subroutine .NewInviteSubroutine (orgClient , mgr ),
37- subroutine .NewRemoveInitializer (mgr , cfg . InitializerName ),
37+ subroutine .NewRemoveInitializer (mgr , cfg , inClusterClient ),
3838 }, log ).
3939 WithReadOnly ().
4040 BuildMultiCluster (mgr ),
@@ -43,9 +43,9 @@ func NewLogicalClusterReconciler(log *logger.Logger, orgClient client.Client, cf
4343
4444func (r * LogicalClusterReconciler ) Reconcile (ctx context.Context , req mcreconcile.Request ) (ctrl.Result , error ) {
4545 ctxWithCluster := mccontext .WithCluster (ctx , req .ClusterName )
46- return r .lifecycle .Reconcile (ctxWithCluster , req , & kcpcorev1alpha1.LogicalCluster {})
46+ return r .mclifecycle .Reconcile (ctxWithCluster , req , & kcpcorev1alpha1.LogicalCluster {})
4747}
4848
4949func (r * LogicalClusterReconciler ) SetupWithManager (mgr mcmanager.Manager , cfg * platformeshconfig.CommonServiceConfig , evp ... predicate.Predicate ) error {
50- return r .lifecycle .SetupWithManager (mgr , cfg .MaxConcurrentReconciles , "LogicalCluster" , & kcpcorev1alpha1.LogicalCluster {}, cfg .DebugLabelValue , r , r .log , evp ... )
50+ return r .mclifecycle .SetupWithManager (mgr , cfg .MaxConcurrentReconciles , "LogicalCluster" , & kcpcorev1alpha1.LogicalCluster {}, cfg .DebugLabelValue , r , r .log , evp ... )
5151}
0 commit comments