community
community copied to clipboard
Use one kind of k8s `api-server` clients in service controllers runtime
Follow-up conversation to #255
Currently the AWS Service controllers uses two kind of k8s api-server clients:
- client-go/kubernetes.Interface used to create the
SharedInformersneeded in the runtime caches - controller-runtime/pkg/client.Client: created by the controller-runtime
Managerand used by theReconcilermethods.
Both clients are create inside the same method ReconcilerBindControllerManager.
We should figure out a better way to do this, ideally by using the same client type for every component that needs a k8s client. The best scenario would be to have something similar to:
func (r *reconciler) BindControllerManager(mgr ctrlrt.Manager) error {
// ...
client := mgr.GetClient()
r.kc = client
r.cache = ackrtcache.New(client r.log)
//...
}
Currently i'm not aware of any function capable of transforming a kubernetes.Interface to client.Client or/and vice versa.
/need-investigation /priority important-long-term
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
Provide feedback via https://github.com/aws-controllers-k8s/community.
/lifecycle stale
/lifecycle frozen