Skip to content
Snippets Groups Projects
Commit e9d5e95c authored by Grzegorz Bizon's avatar Grzegorz Bizon
Browse files

Revert changes in services related to moving projects

parent a9b221d9
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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')
Loading
Loading
Loading
Loading
@@ -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)
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment