Skip to content

Commit

Permalink
Rollback when failed items exist [CLOUDDST-22013] (#238)
Browse files Browse the repository at this point in the history
Also fixed a slow test.
  • Loading branch information
emilyzheng authored Mar 5, 2024
1 parent 0563fcd commit 7e2cb2b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions pubtools/_quay/push_docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -741,8 +741,10 @@ def run(self) -> None:
# Rollback only when all index image builds fails or there are failed items
# Empty iib_results is not an error and shouldn't fail the push. The only exception is
# when bundles presence check failed.
if (iib_results or bundles_presence_check_failed) and (
not any([x["iib_result"] for x in iib_results.values()]) or failed_items
if (
(iib_results or bundles_presence_check_failed)
and (not any([x["iib_result"] for x in iib_results.values()]))
or failed_items
):
if failed_items:
LOG.error("There are failed push items. Cannot continue, running rollback.")
Expand Down
2 changes: 1 addition & 1 deletion tests/test_item_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def test_generate_existing_manifest_map_tolerate_429(operator_signing_push_item)
source_registry="test-registry.io",
reference_registries=["dest-registry.io"],
reference_processor=rp,
extractor=ContentExtractor(quay_client=mock_client),
extractor=ContentExtractor(quay_client=mock_client, sleep_time=0),
)
assert ip.generate_existing_manifests_map(operator_signing_push_item) == {
"test-registry.io": {
Expand Down

0 comments on commit 7e2cb2b

Please sign in to comment.