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
end
def delete_service
fast_delete_enabled = Feature.enabled?(:container_registry_fast_tag_delete, default_enabled: true)
if fast_delete_enabled && @container_repository.client.supports_tag_delete?
if @container_repository.client.supports_tag_delete?
::Projects::ContainerRepository::Gitlab::DeleteTagsService.new(@container_repository, @tag_names)
else
::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
end
context 'when the registry supports fast delete' do
context 'and the feature is enabled' do
before do
allow(repository.client).to receive(:supports_tag_delete?).and_return(true)
end
it_behaves_like 'calling the correct delete tags service', ::Projects::ContainerRepository::Gitlab::DeleteTagsService
it_behaves_like 'handling invalid params'
before do
allow(repository.client).to receive(:supports_tag_delete?).and_return(true)
end
context 'with the real service' do
before do
stub_delete_reference_requests(tags)
expect_delete_tag_by_names(tags)
end
it_behaves_like 'calling the correct delete tags service', ::Projects::ContainerRepository::Gitlab::DeleteTagsService
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
context 'with a timeout error' do
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 { is_expected.to include(status: :success) }
it_behaves_like 'logging an error response', message: 'timeout while deleting tags'
end
it_behaves_like 'logging a success response'
end
context 'and the feature is disabled' do
context 'with a timeout error' do
before do
stub_feature_flags(container_registry_fast_tag_delete: false)
end
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')
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: :success) }
it { is_expected.to include(status: :error, message: 'timeout while deleting tags') }
it_behaves_like 'logging a success response'
end
it_behaves_like 'logging an error response', message: 'timeout while deleting tags'
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