Skip to content

Commit

Permalink
refactor: follower controller
Browse files Browse the repository at this point in the history
  • Loading branch information
mrlihanbo committed Jul 18, 2023
1 parent e66ab67 commit b5febd0
Show file tree
Hide file tree
Showing 4 changed files with 216 additions and 221 deletions.
Binary file added .DS_Store
Binary file not shown.
7 changes: 3 additions & 4 deletions cmd/controller-manager/app/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import (
controllercontext "github.com/kubewharf/kubeadmiral/pkg/controllers/context"
"github.com/kubewharf/kubeadmiral/pkg/controllers/federate"
"github.com/kubewharf/kubeadmiral/pkg/controllers/federatedcluster"
"github.com/kubewharf/kubeadmiral/pkg/controllers/federatedtypeconfig"
"github.com/kubewharf/kubeadmiral/pkg/controllers/follower"
"github.com/kubewharf/kubeadmiral/pkg/controllers/monitor"
"github.com/kubewharf/kubeadmiral/pkg/controllers/scheduler"
Expand Down Expand Up @@ -77,17 +76,17 @@ func startMonitorController(ctx context.Context, controllerCtx *controllercontex
func startFollowerController(ctx context.Context, controllerCtx *controllercontext.Context) (controllermanager.Controller, error) {
controller, err := follower.NewFollowerController(
controllerCtx.KubeClientset,
controllerCtx.DynamicClientset,
controllerCtx.FedClientset,
controllerCtx.DynamicInformerFactory,
controllerCtx.FedInformerFactory.Core().V1alpha1().FederatedObjects(),
controllerCtx.FedInformerFactory.Core().V1alpha1().ClusterFederatedObjects(),
controllerCtx.Metrics,
controllerCtx.WorkerCount,
)
if err != nil {
return nil, fmt.Errorf("error creating follower controller: %w", err)
}

go controller.Run(ctx.Done())
go controller.Run(ctx)

return controller, nil
}
Expand Down
Loading

0 comments on commit b5febd0

Please sign in to comment.