Skip to content

Replace static Spec of GitLab CRD with dynamic Chart values

Hossein Pursultani requested to merge 84-replace-gitlab-spec into master

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:

  1. Restructuring of GitLabSpec and GitLabStatus. The new ChartValues structure allows storing nested maps, i.e. map[string]interface{}. This change is reflect in api/* and config/*. Note that zz_generated.deepcopy.go shouldn't have been versioned.
  2. Changing CustomResourceAdapter to work directly with the values of the CR. Changes in controllers/helpers/{adapter*,template*}.go and helm/* reflects this.
  3. GetBoolValue and GetStringValue helper functions to retrieve the values from GitLab CR (via adapter.Values()). See controllers/helpers/values.go
  4. Replacing any reference to cr.Spec.* with GetBoolValue and GetStringValue. This implies a mapping between Chart values and the deprecated GitLabSpec. 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 in controllers/gitlab/* and some of their ripples slipped into controllers/gitlab_controller.go as well. Majority of these references were already unused when we deprecated generator functions and with CustomResourceAdapter we were decoupled from them. The pieces that need extra attention are: certmanager.go, ingress.go, and types.go. Note that the assumption of disabled HPA is also taken into effect.
  5. Minor tweaks to scripts/test.sh and Makefile to make sure functional test will not run into trouble, e.g. #96 (closed).

Closes #84 (closed)

Edited by Hossein Pursultani

Merge request reports

Loading