Skip to content
代码片段 群组 项目
提交 a743b1c7 编辑于 作者: Siddharth Asthana's avatar Siddharth Asthana
浏览文件

Simplify third party container repository delete tags services

Changelog: other
上级 c26b14ae
No related branches found
No related tags found
无相关合并请求
......@@ -33,7 +33,7 @@ def execute
if deleted_tags.any? && @container_repository.delete_tag_by_digest(deleted_tags.each_value.first)
success(deleted: deleted_tags.keys)
else
error('could not delete tags')
error("could not delete tags: #{@tag_names.join(', ')}".truncate(1000))
end
end
......
......@@ -58,7 +58,19 @@
stub_put_manifest_request('Ba', 500, {})
end
it { is_expected.to eq(status: :error, message: 'could not delete tags') }
it { is_expected.to eq(status: :error, message: "could not delete tags: #{tags.join(', ')}")}
context 'when a large list of tag updates fails' do
let(:tags) { Array.new(1000) { |i| "tag_#{i}" } }
before do
expect(service).to receive(:replace_tag_manifests).and_return({})
end
it 'truncates the log message' do
expect(subject).to eq(status: :error, message: "could not delete tags: #{tags.join(', ')}".truncate(1000))
end
end
end
context 'a single tag update fails' do
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册