summaryrefslogtreecommitdiff
path: root/lib/container_registry
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-04-18 22:20:47 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-04-18 22:20:47 +0200
commitf6a11d00a8d938293a6a223c6f227b935ebe7a3c (patch)
treef2c34e53147ccbc79098ae28124e21990a91d9e4 /lib/container_registry
parentf88762a5f577fa620e77f38fb6812fe4ee53d237 (diff)
downloadgitlab-ce-f6a11d00a8d938293a6a223c6f227b935ebe7a3c.tar.gz
Fix duplicated container repository names
Diffstat (limited to 'lib/container_registry')
-rw-r--r--lib/container_registry/path.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/container_registry/path.rb b/lib/container_registry/path.rb
index 4a585996aa5..61849a40383 100644
--- a/lib/container_registry/path.rb
+++ b/lib/container_registry/path.rb
@@ -48,7 +48,7 @@ module ContainerRegistry
end
def root_repository?
- @path == repository_project.full_path
+ @path == project_path
end
def repository_project
@@ -60,7 +60,13 @@ module ContainerRegistry
def repository_name
return unless has_project?
- @path.remove(%r(^#{Regexp.escape(repository_project.full_path)}/?))
+ @path.remove(%r(^#{Regexp.escape(project_path)}/?))
+ end
+
+ def project_path
+ return unless has_project?
+
+ repository_project.full_path.downcase
end
def to_s