diff options
author | Stan Hu <stanhu@gmail.com> | 2019-08-06 23:36:07 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-08-06 23:44:26 +0300 |
commit | 35ce4820f24c15a5c7bdb111d73a90fd9bea2655 (patch) | |
tree | 756a3073eee14f720e1cfd82c3766b62209eaf10 /spec/services/projects/destroy_service_spec.rb | |
parent | 921611d19dff9aed8d4c35edd0578614630a01c8 (diff) |
Don't attempt to contact registry if it is disabled
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/21679 moved the
deletion of registry tags outside of a transaction, but introduced an
issue where Sidekiq would attempt to contact the container registry
during project destruction even if it were disabled.
Relates to:
* https://gitlab.com/charts/gitlab/issues/1455
* https://gitlab.com/gitlab-org/gitlab-ce/issues/45941
Diffstat (limited to 'spec/services/projects/destroy_service_spec.rb')
-rw-r--r-- | spec/services/projects/destroy_service_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/services/projects/destroy_service_spec.rb b/spec/services/projects/destroy_service_spec.rb index e436af77ed4..9a6f64b825a 100644 --- a/spec/services/projects/destroy_service_spec.rb +++ b/spec/services/projects/destroy_service_spec.rb @@ -241,6 +241,18 @@ describe Projects::DestroyService do expect(destroy_project(project, user)).to be false end end + + context 'when registry is disabled' do + before do + stub_container_registry_config(enabled: false) + end + + it 'does not attempting to remove any tags' do + expect(Projects::ContainerRepository::DestroyService).not_to receive(:new) + + destroy_project(project, user) + end + end end context 'when there are tags for legacy root repository' do |