Skip to content

Template the image string to allow using `{{.Chart.AppVersion}}` reference

Marc Bollhalder requested to merge NoRelect/gitlab-runner:template-image into main

What does this MR do?

This MR allows users of custom image registries to use the ubuntu or rootless version of the runner without having to update the values.yaml for each new gitlab runner version.

image:
  registry: custom-registry.example.com
  tag: v{{.Chart.AppVersion}}

Why was this MR needed?

Previously, the tag would always need to be hardcoded to a specific ubuntu runner version or be forced to use the alpine version. With this MR, the values file doesn't need to be changed to update the runner version (a chart update will be enough).

What's the best way to test this MR?

Run helm template gitlab-runner --set 'image.tag=\{\{.Chart.AppVersion\}\}' . | grep "image:".

This should now output:

image: registry.gitlab.com/gitlab-org/gitlab-runner:bleeding

instead of

image: registry.gitlab.com/gitlab-org/gitlab-runner:{{.Chart.AppVersion}}

What are the relevant issue numbers?

None.

Merge request reports

Loading