From 7d3d1ec5a7b3ee13397af587c6ecb3a3fc297006 Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Thu, 30 Mar 2017 15:24:46 +0200 Subject: 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. --- lib/container_registry/path.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib') 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 -- cgit v1.2.1