提交 e9d5e95c 编写于 作者: G Grzegorz Bizon

Revert changes in services related to moving projects

上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册