werf/kubedog

Rework internal resource trackers

distorhead opened this issue · 0 comments

The problem: there is a lot of repeated code in each tracker in pkg/tracker, it is:

  1. hard to maintain this code and fix bugs;
  2. hard to add new trackers for custom resources, because a lot of code need to be copied.

Solution: rework pkg/tracker, so that:

  • it uses dynamic kubernetes client;
  • it implements some common base resource with typical operations needed to implement any concrete resource tracker;
  • it does not mix representational logic with status reporting mechanics (status-indicators in the current implementation should not be implemented in the resource trackers, but instead should be implemented at the multitracker level).

1st step includes:

  • implementing new framework to build resource trackers;
  • implementing Deployment tracker on top of such framework;
  • implementing compatibility adapter for Deployment so that new tracker can be used in the current version of multitracker.