Commit 074128b8 authored by Markus Koller's avatar Markus Koller

Merge branch '257821-remove-container_registry_fast_tag_delete-feature-flag' into 'master'

Remove the `container_registry_fast_tag_delete` feature flag

See merge request gitlab-org/gitlab!43555
parents 6c3ddc14 a101684d
...@@ -23,9 +23,7 @@ module Projects ...@@ -23,9 +23,7 @@ module Projects
end end
def delete_service def delete_service
fast_delete_enabled = Feature.enabled?(:container_registry_fast_tag_delete, default_enabled: true) if @container_repository.client.supports_tag_delete?
if fast_delete_enabled && @container_repository.client.supports_tag_delete?
::Projects::ContainerRepository::Gitlab::DeleteTagsService.new(@container_repository, @tag_names) ::Projects::ContainerRepository::Gitlab::DeleteTagsService.new(@container_repository, @tag_names)
else else
::Projects::ContainerRepository::ThirdParty::DeleteTagsService.new(@container_repository, @tag_names) ::Projects::ContainerRepository::ThirdParty::DeleteTagsService.new(@container_repository, @tag_names)
......
---
name: container_registry_fast_tag_delete
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/23325
rollout_issue_url:
group: group::package
type: development
default_enabled: true
...@@ -104,59 +104,35 @@ RSpec.describe Projects::ContainerRepository::DeleteTagsService do ...@@ -104,59 +104,35 @@ RSpec.describe Projects::ContainerRepository::DeleteTagsService do
end end
context 'when the registry supports fast delete' do context 'when the registry supports fast delete' do
context 'and the feature is enabled' do before do
before do allow(repository.client).to receive(:supports_tag_delete?).and_return(true)
allow(repository.client).to receive(:supports_tag_delete?).and_return(true) end
end
it_behaves_like 'calling the correct delete tags service', ::Projects::ContainerRepository::Gitlab::DeleteTagsService
it_behaves_like 'handling invalid params'
context 'with the real service' do it_behaves_like 'calling the correct delete tags service', ::Projects::ContainerRepository::Gitlab::DeleteTagsService
before do
stub_delete_reference_requests(tags)
expect_delete_tag_by_names(tags)
end
it { is_expected.to include(status: :success) } it_behaves_like 'handling invalid params'
it_behaves_like 'logging a success response' context 'with the real service' do
before do
stub_delete_reference_requests(tags)
expect_delete_tag_by_names(tags)
end end
context 'with a timeout error' do it { is_expected.to include(status: :success) }
before do
expect_next_instance_of(::Projects::ContainerRepository::Gitlab::DeleteTagsService) do |delete_service|
expect(delete_service).to receive(:delete_tags).and_raise(::Projects::ContainerRepository::Gitlab::DeleteTagsService::TimeoutError)
end
end
it { is_expected.to include(status: :error, message: 'timeout while deleting tags') }
it_behaves_like 'logging an error response', message: 'timeout while deleting tags' it_behaves_like 'logging a success response'
end
end end
context 'and the feature is disabled' do context 'with a timeout error' do
before do before do
stub_feature_flags(container_registry_fast_tag_delete: false) expect_next_instance_of(::Projects::ContainerRepository::Gitlab::DeleteTagsService) do |delete_service|
end expect(delete_service).to receive(:delete_tags).and_raise(::Projects::ContainerRepository::Gitlab::DeleteTagsService::TimeoutError)
it_behaves_like 'calling the correct delete tags service', ::Projects::ContainerRepository::ThirdParty::DeleteTagsService
it_behaves_like 'handling invalid params'
context 'with the real service' do
before do
stub_upload('sha256:4435000728ee66e6a80e55637fc22725c256b61de344a2ecdeaac6bdb36e8bc3')
tags.each { |tag| stub_put_manifest_request(tag) }
expect_delete_tag_by_digest('sha256:dummy')
end end
end
it { is_expected.to include(status: :success) } it { is_expected.to include(status: :error, message: 'timeout while deleting tags') }
it_behaves_like 'logging a success response' it_behaves_like 'logging an error response', message: 'timeout while deleting tags'
end
end end
end end
......
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