Skip to content
Snippets Groups Projects
Commit 8aef2d02 authored by Eric Engestrom's avatar Eric Engestrom
Browse files

ci: fix $CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX for non-lowercase groups

Docker does not allow uppercase characters in the image path, but GitLab
allows them in the group name, which is used in the dependency proxy's
image prefix.

The proxy already works with lowercased group names, the only thing
needed is to make sure we pass the correct prefix to the CI and to the
web page user.
parent 91817c59
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !54559. Comments created here will be created in the context of that merge request.
...@@ -2026,7 +2026,9 @@ def dependency_proxy_variables ...@@ -2026,7 +2026,9 @@ def dependency_proxy_variables
variables.append(key: 'CI_DEPENDENCY_PROXY_SERVER', value: "#{Gitlab.config.gitlab.host}:#{Gitlab.config.gitlab.port}") variables.append(key: 'CI_DEPENDENCY_PROXY_SERVER', value: "#{Gitlab.config.gitlab.host}:#{Gitlab.config.gitlab.port}")
variables.append( variables.append(
key: 'CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX', key: 'CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX',
value: "#{Gitlab.config.gitlab.host}:#{Gitlab.config.gitlab.port}/#{namespace.root_ancestor.path}#{DependencyProxy::URL_SUFFIX}" # The namespace path can include uppercase letters, which
# Docker doesn't allow. The proxy expects it to be downcased.
value: "#{Gitlab.config.gitlab.host}:#{Gitlab.config.gitlab.port}/#{namespace.root_ancestor.path.downcase}#{DependencyProxy::URL_SUFFIX}"
) )
end end
end end
......
- proxy_url = "#{group_url(@group)}#{DependencyProxy::URL_SUFFIX}" -# The namespace path can include uppercase letters, which
-# Docker doesn't allow. The proxy expects it to be downcased.
- proxy_url = "#{group_url(@group).downcase}#{DependencyProxy::URL_SUFFIX}"
%h5.prepend-top-20= _('Dependency proxy URL') %h5.prepend-top-20= _('Dependency proxy URL')
......
---
title: Fix the value of `$CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX` when used in group with a name containing uppercase letters
merge_request: 54559
author: Eric Engestrom @1ace
type: fixed
...@@ -93,6 +93,7 @@ You can authenticate using: ...@@ -93,6 +93,7 @@ You can authenticate using:
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/280582) in GitLab 13.7. > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/280582) in GitLab 13.7.
> - Automatic runner authentication [added](https://gitlab.com/gitlab-org/gitlab-runner/-/issues/27302) in GitLab 13.9. > - Automatic runner authentication [added](https://gitlab.com/gitlab-org/gitlab-runner/-/issues/27302) in GitLab 13.9.
> - The prefix for group names containing uppercase letters was [fixed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/54559) in GitLab 13.10.
Runners log in to the Dependency Proxy automatically. To pull through Runners log in to the Dependency Proxy automatically. To pull through
the Dependency Proxy, use the `CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX` the Dependency Proxy, use the `CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX`
......
...@@ -2409,7 +2409,7 @@ ...@@ -2409,7 +2409,7 @@
{ key: 'CI_PAGES_URL', value: project.pages_url, public: true, masked: false }, { key: 'CI_PAGES_URL', value: project.pages_url, public: true, masked: false },
{ key: 'CI_DEPENDENCY_PROXY_SERVER', value: "#{Gitlab.config.gitlab.host}:#{Gitlab.config.gitlab.port}", public: true, masked: false }, { key: 'CI_DEPENDENCY_PROXY_SERVER', value: "#{Gitlab.config.gitlab.host}:#{Gitlab.config.gitlab.port}", public: true, masked: false },
{ key: 'CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX', { key: 'CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX',
value: "#{Gitlab.config.gitlab.host}:#{Gitlab.config.gitlab.port}/#{project.namespace.root_ancestor.path}#{DependencyProxy::URL_SUFFIX}", value: "#{Gitlab.config.gitlab.host}:#{Gitlab.config.gitlab.port}/#{project.namespace.root_ancestor.path.downcase}#{DependencyProxy::URL_SUFFIX}",
public: true, public: true,
masked: false }, masked: false },
{ key: 'CI_API_V4_URL', value: 'http://localhost/api/v4', public: true, masked: false }, { key: 'CI_API_V4_URL', value: 'http://localhost/api/v4', public: true, masked: false },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment