Read about our upcoming Code of Conduct on this issue

This instance will be upgraded to Heptapod 0.28.0 on 2022-01-18 at 14:00 UTC+1 (a few minutes of down time)

Commit e9d5e95c authored by Grzegorz Bizon's avatar Grzegorz Bizon
Browse files

Revert changes in services related to moving projects

parent e1e9aea299ed
......@@ -150,7 +150,7 @@ def move_dir
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 @@ def rename_repo
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 @@ def transfer(project, new_namespace)
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