Commit f4c9a981 authored by Steve Abrams's avatar Steve Abrams

Fix dependency proxy image prefix

Changelog: fixed
parent 72148118
...@@ -276,7 +276,7 @@ class Group < Namespace ...@@ -276,7 +276,7 @@ class Group < Namespace
def dependency_proxy_image_prefix def dependency_proxy_image_prefix
# The namespace path can include uppercase letters, which # The namespace path can include uppercase letters, which
# Docker doesn't allow. The proxy expects it to be downcased. # Docker doesn't allow. The proxy expects it to be downcased.
url = "#{web_url.downcase}#{DependencyProxy::URL_SUFFIX}" url = "#{Gitlab::Routing.url_helpers.group_url(self).downcase}#{DependencyProxy::URL_SUFFIX}"
# Docker images do not include the protocol # Docker images do not include the protocol
url.partition('//').last url.partition('//').last
......
...@@ -2756,6 +2756,10 @@ RSpec.describe Group do ...@@ -2756,6 +2756,10 @@ RSpec.describe Group do
it 'removes the protocol' do it 'removes the protocol' do
expect(group.dependency_proxy_image_prefix).not_to include('http') expect(group.dependency_proxy_image_prefix).not_to include('http')
end end
it 'does not include /groups' do
expect(group.dependency_proxy_image_prefix).not_to include('/groups')
end
end end
describe '#dependency_proxy_image_ttl_policy' do describe '#dependency_proxy_image_ttl_policy' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment