From 22726942fe0b6c11c20de070cc9784de12ca2ce6 Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Thu, 13 Apr 2017 09:11:41 +0200 Subject: Fix registry for projects with uppercases in path --- lib/container_registry/path.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/container_registry/path.rb') diff --git a/lib/container_registry/path.rb b/lib/container_registry/path.rb index a4b5f2aba6c..30828bb6565 100644 --- a/lib/container_registry/path.rb +++ b/lib/container_registry/path.rb @@ -15,7 +15,7 @@ module ContainerRegistry LEVELS_SUPPORTED = 3 def initialize(path) - @path = path + @path = path.downcase end def valid? -- cgit v1.2.3 From 37ab389139a21a8ab10ddbbddec1b61f720b27ab Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Thu, 13 Apr 2017 09:18:46 +0200 Subject: Revert "Fix registry for projects with uppercases in path" This reverts commit 22726942fe0b6c11c20de070cc9784de12ca2ce6. --- lib/container_registry/path.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/container_registry/path.rb') diff --git a/lib/container_registry/path.rb b/lib/container_registry/path.rb index 30828bb6565..a4b5f2aba6c 100644 --- a/lib/container_registry/path.rb +++ b/lib/container_registry/path.rb @@ -15,7 +15,7 @@ module ContainerRegistry LEVELS_SUPPORTED = 3 def initialize(path) - @path = path.downcase + @path = path end def valid? -- cgit v1.2.3 From 259108ada340a0f1d49e2d80d1c433a377983e1c Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Thu, 13 Apr 2017 09:20:42 +0200 Subject: Fix registry for projects with uppercases in path --- lib/container_registry/path.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/container_registry/path.rb') diff --git a/lib/container_registry/path.rb b/lib/container_registry/path.rb index a4b5f2aba6c..30828bb6565 100644 --- a/lib/container_registry/path.rb +++ b/lib/container_registry/path.rb @@ -15,7 +15,7 @@ module ContainerRegistry LEVELS_SUPPORTED = 3 def initialize(path) - @path = path + @path = path.downcase end def valid? -- cgit v1.2.3 From b5b6c7b17527cc2360066557207af935bec2168f Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Thu, 13 Apr 2017 11:54:02 +0200 Subject: Sanitize container repository path in model class --- lib/container_registry/path.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/container_registry/path.rb') diff --git a/lib/container_registry/path.rb b/lib/container_registry/path.rb index 30828bb6565..4a585996aa5 100644 --- a/lib/container_registry/path.rb +++ b/lib/container_registry/path.rb @@ -15,7 +15,7 @@ module ContainerRegistry LEVELS_SUPPORTED = 3 def initialize(path) - @path = path.downcase + @path = path.to_s.downcase end def valid? @@ -25,7 +25,7 @@ module ContainerRegistry end def components - @components ||= @path.to_s.split('/') + @components ||= @path.split('/') end def nodes -- cgit v1.2.3 From f6a11d00a8d938293a6a223c6f227b935ebe7a3c Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Tue, 18 Apr 2017 22:20:47 +0200 Subject: Fix duplicated container repository names --- lib/container_registry/path.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lib/container_registry/path.rb') 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 -- cgit v1.2.3