feature: Remove need of filepath CI vars
What does this MR do?
On !81 (diffs) we removed the need of the CI variables for values files having to be set.
Now, we're also defaulting these paths to what we expect them to be in our docs. These will allows us to remove these env var definitions from https://gitlab.com/gitlab-org/gitlab/-/blob/fde9ba94cfb77463e6a45281f1dce04174dc353d/lib/gitlab/ci/templates/Managed-Cluster-Applications.gitlab-ci.yml.
How it works
For each app, we add and else
clause in the apps helmfile to set the file path as the expected default but only if the user did not specify a specific path. E.g.:
{{- if env "INGRESS_VALUES_FILE" }}
- {{ env "INGRESS_VALUES_FILE" | quote }}
+++ {{- else }}
+++ - {{ env "CI_PROJECT_DIR" }}/.gitlab/managed-apps/ingress/values.yaml
{{- end }}
New specs
I decided to add automated tests checking that we're indeed defaulting the values file path to .gitlab/managed-apps/{app_name}/values.yaml
. This way we don't need to manual QA all the applications and we guarantee that this functionality always works. To accomplish this the strategy was basically the following:
- Add a
.gitlab/managed-apps/{app_name}/values.yaml
in this repo for each application we have, with some custom values. - Change the
test/managed-apps/{app_name}/verify
to check that this default file is adding some custom config for each app.
Screenshots
Manual QA
-
Test this change using a Cluster management project