Break down the Custom Resource Adapter
Summary
We can break down gitlab.CustomResourceAdapter into two separate interfaces to distinguish between "generic" and "specific" parts.
The generic part is anything that can be associated to any Custom Resource and not just GitLab. This includes Custom Resource wrapping, and access to the value bindings.
The specific part is anything that is directly related to a GitLab resource, for example ChartVersion, IsUpgrade, etc. This still needs to be an interface despite the fact that it is specific. This will contain the CRD version changes. More of GitLab resource specific operations can be pulled into this interface (or more interfaces), for example IsXyzEnabled helpers. This interface embeds the generic interface.
Acceptance criteria
-
Factor out the generic aspects of gitlab.CustomResourceAdapterinto another interface(s). -
Factor out the specific aspects of gitlab.CustomResourceAdapterinto another interface, e.g.GitLabWrapper. -
Refactor NewCustomResourceAdapter. -
Change all the references to gitlab.CustomResourceAdapterand replace them with new interfaces. -
Relocate the "generic" interface(s) to /pkgdirectory underadapterpackage. -
Relocate the "specific" interface(s) and builder function(s) to /internaldirectory underadapterpackage.
Edited by Hossein Pursultani