summaryrefslogtreecommitdiff
path: root/lib/container_registry/path.rb
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-03-30 15:24:46 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-03-30 15:24:46 +0200
commit7d3d1ec5a7b3ee13397af587c6ecb3a3fc297006 (patch)
tree9b05a3320cf773196afde017688ef333962add3e /lib/container_registry/path.rb
parent236c9c170374190bcb6dc54a1ca3dddda2d3dcb2 (diff)
downloadgitlab-ce-7d3d1ec5a7b3ee13397af587c6ecb3a3fc297006.tar.gz
Create container repository on successful push auth
Because we do not have yet two way communication between container registry and GitLab, we need to eagerly create a new container repository objects in database. We now do that after user/build successfully authenticates a push action using auth service.
Diffstat (limited to 'lib/container_registry/path.rb')
-rw-r--r--lib/container_registry/path.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/container_registry/path.rb b/lib/container_registry/path.rb
index 3a6fde08e8f..27e0e7897ff 100644
--- a/lib/container_registry/path.rb
+++ b/lib/container_registry/path.rb
@@ -44,6 +44,10 @@ module ContainerRegistry
.where(name: repository_name).any?
end
+ def root_repository?
+ @path == repository_project.full_path
+ end
+
def repository_project
@project ||= Project.where_full_path_in(components.first(3))&.first
end