Allow overriding image.registry to remove slash
What does this MR do?
Currently the .Values.image.registry
is concatenated with the image and tag "registry/image:tag"
so when the registry is set to an empty string, then the resulting image is "/image:tag"
which is an invalid image path. This change removes that preceding slash.
- In the
_helpers.tpl
that generates the"gitlab-runner.image"
, check to see if the registry is set to an empty string and don't include a slash in the result
Why was this MR needed?
On deployed environments using a registry proxy, the default registry can be set on the Kubernetes nodes and not explicitly defined in the deployment definition.
What's the best way to test this MR?
# Verify the full image works with a registry
helm template --debug ./ | grep "image:"
# Results in:
# image: registry.gitlab.com/gitlab-org/gitlab-runner:alpine-bleeding
# Verify the image without a registry
helm template --debug --set image.registry="" ./ | grep "image:"
# Results in:
# image: gitlab-org/gitlab-runner:alpine-bleeding
# Behavior without a registry prior to this change
# image: /gitlab-org/gitlab-runner:alpine-bleeding
What are the relevant issue numbers?
N/A