fix: extend checkDuplicateKeyFromEnv for webservice deployments
Note
This MR was created by Duo in Session 1138713
I, @Alexand, then later assessed the changes and overrode some to adapt to what I think was adequate.
Changes
- Extend
checkDuplicateKeyFromEnv
template to check deployment-levelextraEnv
for webservice multiple deployments. - Extend
checkDuplicateKeyFromEnv
template to check pod-levelextraEnv
for sidekiq multiple pods. - Also extends
gitlab.godebug.env
for both above, as it usescheckDuplicateKeyFromEnv
under the hood. - Fix GODEBUG environment variable duplication in webservice deployments with different extraEnv configurations.
- Ensure the template considers all scopes: root, local, global, and deployment/pod-level extraEnv.
Implementation details
I couldn't use the same pattern as before which was to traverse the rootScope looking for children keys because deployments and pods can be any number of, and they can get custom names, so doing the mapping would be much more complex. The more straight-forward solution was to also pass the loop iterator context to the templates that need them as an argument. I.e., instead of simply calling the template with $
(root scope), we now pass a dictionary which contains both $
and .
(local context evaluated within the loop).
Related issues
Closes #6159 (closed)
Author checklist
For general guidance, please follow our Contributing guide.
Required
For anything in this list which will not be completed, please provide a reason in the MR discussion.
-
Merge Request Title and Description are up to date, accurate, and descriptive. -
MR targeting the appropriate branch. -
MR has a green pipeline. -
Documentation created/updated. -
Tests added/updated, and test plan for scenarios not covered by automated tests. -
Equivalent MR/issue for omnibus-gitlab opened.
Reviewers checklist
-
MR has a green pipeline on https://gitlab.com/gitlab-org/charts/gitlab. -
Consider downstream impact to the Operator, as per evaluating impact from changes to GitLab chart.