Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
luolanzone committed Oct 23, 2023
1 parent 9b8d6f8 commit cfff914
Show file tree
Hide file tree
Showing 21 changed files with 540 additions and 831 deletions.
6 changes: 2 additions & 4 deletions multicluster/cmd/multicluster-controller/leader.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,14 @@ func runLeader(o *Options) error {
return fmt.Errorf("error creating ResourceExport webhook: %v", err)
}

staleController := leader.NewLeaderStaleResCleanupController(
staleController := leader.NewStaleResCleanupController(
mgr.GetClient(),
mgr.GetScheme(),
env.GetPodNamespace(),
)
if err = staleController.SetupWithManager(mgr, stopCh); err != nil {
return fmt.Errorf("error creating LeaderStaleResCleanupController: %v", err)
return fmt.Errorf("error creating StaleResCleanupController: %v", err)
}
go staleController.RunPeriodically(stopCh)
go staleController.RunOnce(stopCh)

klog.InfoS("Leader MC Controller Starting Manager")
if err := mgr.Start(ctrl.SetupSignalHandler()); err != nil {
Expand Down
10 changes: 6 additions & 4 deletions multicluster/cmd/multicluster-controller/member.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,13 @@ func runMember(o *Options) error {
role: memberRole},
})

commonAreaCreationCh := make(chan struct{})
clusterSetReconciler := member.NewMemberClusterSetReconciler(mgr.GetClient(),
mgr.GetScheme(),
env.GetPodNamespace(),
o.EnableStretchedNetworkPolicy,
o.ClusterCalimCRDAvailable,
commonAreaCreationCh,
)
if err = clusterSetReconciler.SetupWithManager(mgr); err != nil {
return fmt.Errorf("error creating ClusterSet controller: %v", err)
Expand Down Expand Up @@ -121,16 +123,16 @@ func runMember(o *Options) error {
return fmt.Errorf("error creating Node controller: %v", err)
}

staleController := member.NewMemberStaleResCleanupController(
staleController := member.NewStaleResCleanupController(
mgr.GetClient(),
mgr.GetScheme(),
commonAreaCreationCh,
env.GetPodNamespace(),
commonAreaGetter,
)
if err = staleController.SetupWithManager(mgr); err != nil {
return fmt.Errorf("error creating MemberStaleResCleanupController: %v", err)
}

go staleController.Run(stopCh)

// Member runs ResourceImportReconciler from RemoteCommonArea only

klog.InfoS("Member MC Controller Starting Manager")
Expand Down
172 changes: 0 additions & 172 deletions multicluster/controllers/multicluster/common/cleanup.go

This file was deleted.

Loading

0 comments on commit cfff914

Please sign in to comment.