• 开发
  • kubesphere控制器源代码的逻辑是否有重复的代码?

用kubebuilder创建的crd/controller,直接在Reconcile()里写逻辑,比如创建quota.Reconciler{},stepWithManager()

但比如clusterController,是独立的controller,然后又加入add到kubebuilder/manager中
https://github.com/kubesphere/kubesphere/blob/master/pkg/controller/cluster/cluster_controller.go
是用的原生的workqueue,start/run/worker/processNextItem等

目前源代码中的 clusterController集群控制器逻辑,是不是相当于从kubebuilder封装的controller-runtime中的workqueue中取数据,因为controller-runtime已经封装过了workqueue。
https://github.com/kubernetes-sigs/controller-runtime/blob/master/pkg/internal/controller/controller.go
而kubesphere中的比如clusterController却再次加入自己的workqueue,因为像clusterController代码中,就重新实现了一份workqueue的处理逻辑,这是把事件再次写入队列?这是不是多了一次