senthilrch / kube-fledged

A kubernetes operator for creating and managing a cache of container images directly on the cluster worker nodes, so application pods start almost instantly
Apache License 2.0
1.26k stars 119 forks source link

Enhancement: Refactor controller syncHandler() method #206

Open senthilrch opened 1 year ago

senthilrch commented 1 year ago

The syncHandler() method of the controller is where the controller reconciles the desired state of ImageCache with actual state. The syncHandler, before starting the reconciliation, updates the status of ImageCache (interim status) to Processing.

The business logic to update the status is currently within the syncHandler() method, with some amount of boiler plate. the logic to construct the status variable is best moved to separate methods of the controller. Proposal is to have two different methods:-