summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2016-06-01 22:06:25 +0000
committerYorick Peterse <yorickpeterse@gmail.com>2016-06-02 13:43:25 +0200
commite601e683bcdee8eae00583aae713d69afc9eaa07 (patch)
treea698aa8d05d6735887217aefd6a5ebacebd50c32 /app
parenteb48969ad59107de82bfcbf9fd8461ad0f0932be (diff)
downloadgitlab-ce-e601e683bcdee8eae00583aae713d69afc9eaa07.tar.gz
Merge branch 'downcase-registry-repository' into 'master'
Use downcased path to container repository as this is expected path by Docker Docker Engine requires path to be lowercase. This makes all container registry paths to be show and used downcased instead of mixed case. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/17959 See merge request !4420
Diffstat (limited to 'app')
-rw-r--r--app/models/project.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index 37de1dfe4d5..4e3d92507f5 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -309,21 +309,25 @@ class Project < ActiveRecord::Base
@repository ||= Repository.new(path_with_namespace, self)
end
+ def container_registry_path_with_namespace
+ path_with_namespace.downcase
+ end
+
def container_registry_repository
return unless Gitlab.config.registry.enabled
@container_registry_repository ||= begin
- token = Auth::ContainerRegistryAuthenticationService.full_access_token(path_with_namespace)
+ token = Auth::ContainerRegistryAuthenticationService.full_access_token(container_registry_path_with_namespace)
url = Gitlab.config.registry.api_url
host_port = Gitlab.config.registry.host_port
registry = ContainerRegistry::Registry.new(url, token: token, path: host_port)
- registry.repository(path_with_namespace)
+ registry.repository(container_registry_path_with_namespace)
end
end
def container_registry_repository_url
if Gitlab.config.registry.enabled
- "#{Gitlab.config.registry.host_port}/#{path_with_namespace}"
+ "#{Gitlab.config.registry.host_port}/#{container_registry_path_with_namespace}"
end
end