Replace the Adapter for GitLab custom resource
This MR is based on !520 (merged)
Summary
This MR removes CustomResourceAdapter (from controllers/gitlab) and replaces it with the new Adapter for GitLab custom resource (from pkg/gitlab).
Required adjustments are made to fit the new adapter into its place, including changing the template builder and caching mechanism (by simplifying them).
It also removes *Enabled functions (and their associated constants) and uses the WantsComponent and WantsFeature functions of Adapter instead.
This is the last piece of a series of MRs to resolve #429 (closed).
Structure of the Change
This change is big but it can be easily understood using the following structure:
- The major structural changes to
pkg/are moved into !520 (merged) and once it is merged this MR has to be rebased. - The rest of the changes in
pkg/are either minor tweaks, such as renaming a variable, or introduces new features or components, including toolbox CronJob and declaring Prometheus component. - Changes in
helm/are adjustments to Helm template facility to make it work with the new adapter. The most important change in the new adapter that impacts the Helm template is the way that it calculates the hash based on the UID and Generation of the underlying object. This changed the template cache and in fact made it simpler. The other change is that the adapter now can return its related Chart so the template engine doesn't have to locate anymore. - The changes in
controllers/are the direct impact of the changing type. Its package, name, and signature has changed and hence the way that it is used. - There is another set of changes in
controllers/whereXyzEnabledfunctions and their related constants are removed. These are replaced withWantsComponentandWantsFeature.
Bottom line, this MR mostly removes the code from controllers/ to make it simpler as intended.
Closes #429 (closed) Closes #430 (closed)