summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-06-01 22:57:50 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2016-06-01 22:57:50 +0200
commit77cb8ec4d14e3a8b03164423176b3b95977ee809 (patch)
tree52cfc71ed426ea2c2efc037cfb79d2bb5485c769 /app
parentd1fdefeecdf9305f65a7b78bc0c2218f2dcd9956 (diff)
downloadgitlab-ce-77cb8ec4d14e3a8b03164423176b3b95977ee809.tar.gz
Introduce container_registry_path_with_namespacedowncase-registry-repository
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 13376da9948..525a82c7534 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.downcase)
+ 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.downcase)
+ 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.downcase}"
+ "#{Gitlab.config.registry.host_port}/#{container_registry_path_with_namespace}"
end
end