Add GitLab-specific template functions
This MR is forked out of !32 (merged) and helps development of !31 (merged) as well as incoming MR for #5 (closed).
What does this MR do?
The template engine is changed to allow registering custom functions easily and passing them to the downstream template inventories.
Two basic GitLab-specific functions are introduced:
-
glCommonLabels
: Generates a list of Kubernetes common labels for GitLab-managed resources. -
glImage
: Combines image sources and calculates the full image reference for various GitLab components given the version and edition of GitLab.
Usage
For usage see !32 (merged):
{{- glCommonLabels .GitLab $Component | toYaml | nindent 4 }}
{{ glImage $.GitLab $.GitLab.Spec.ApplicationServer.Images.Puma "puma" }}
Author's Checklist
For anything in this list which will not be completed, please provide a reason in the MR discussion.
Required
-
Ensure a release milestone is set. -
MR title and description are up to date, accurate, and descriptive. -
MR targeting the appropriate branch. -
MR has a green pipeline on GitLab.com. -
When ready for review, MR is labeled workflowready for review per the MR workflow.
Expected
-
Test plan indicating conditions for success has been posted and passes. -
Documentation is created or updated. -
Tests are added.
Related issues
Edited by Clemens Beck