Commit e9d5e95c authored by Grzegorz Bizon's avatar Grzegorz Bizon

Revert changes in services related to moving projects

parent a9b221d9
......@@ -150,7 +150,7 @@ class Namespace < ActiveRecord::Base
end
def any_project_has_container_registry_images?
projects.joins(:container_repositories).any?
projects.any?(&:has_container_registry_tags?)
end
def send_update_instructions
......
......@@ -894,8 +894,8 @@ class Project < ActiveRecord::Base
expire_caches_before_rename(old_path_with_namespace)
if container_repositories.present?
Rails.logger.error "Project #{old_path_with_namespace} cannot be renamed because container registry images are present"
if has_container_registry_tags?
Rails.logger.error "Project #{old_path_with_namespace} cannot be renamed because container registry tags are present!"
# we currently doesn't support renaming repository if it contains images in container registry
raise StandardError.new('Project cannot be renamed, because images are present in its container registry')
......
......@@ -36,9 +36,9 @@ module Projects
raise TransferError.new("Project with same path in target namespace already exists")
end
unless project.container_repositories.empty?
if project.has_container_registry_tags?
# we currently doesn't support renaming repository if it contains images in container registry
raise TransferError.new('Project cannot be transferred, because images are present in its container registry')
raise TransferError.new('Project cannot be transferred, because tags are present in its container registry')
end
project.expire_caches_before_rename(old_path)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment