Replace static Spec of GitLab CRD with dynamic Chart values
This MR replaces GitLab CRD Spec with and unstructured payload that can be consumed directly by Helm facility. It contains numerous changes which can be categorized as follows:
- Restructuring of
GitLabSpec
andGitLabStatus
. The newChartValues
structure allows storing nested maps, i.e.map[string]interface{}
. This change is reflect inapi/*
andconfig/*
. Note thatzz_generated.deepcopy.go
shouldn't have been versioned. - Changing
CustomResourceAdapter
to work directly with the values of the CR. Changes incontrollers/helpers/{adapter*,template*}.go
andhelm/*
reflects this. -
GetBoolValue
andGetStringValue
helper functions to retrieve the values from GitLab CR (viaadapter.Values()
). Seecontrollers/helpers/values.go
- Replacing any reference to
cr.Spec.*
withGetBoolValue
andGetStringValue
. This implies a mapping between Chart values and the deprecatedGitLabSpec
. Only selected Spec fields that are used have been mapped to Chart values. The rest, that are unused, are commented, deleted, or replaced with a sensible default value. Theses changes are mostly incontrollers/gitlab/*
and some of their ripples slipped intocontrollers/gitlab_controller.go
as well. Majority of these references were already unused when we deprecated generator functions and withCustomResourceAdapter
we were decoupled from them. The pieces that need extra attention are:certmanager.go
,ingress.go
, andtypes.go
. Note that the assumption of disabled HPA is also taken into effect. - Minor tweaks to
scripts/test.sh
andMakefile
to make sure functional test will not run into trouble, e.g. #96 (closed).
Closes #84 (closed)
Edited by Hossein Pursultani