@@ -978,13 +978,13 @@ def test_apply_repo_enclosure(original_image, eclosure_namespace, expected_image
978978@mock .patch ('iib.workers.tasks.build_regenerate_bundle._adjust_csv_annotations' )
979979@mock .patch ('iib.workers.tasks.build_regenerate_bundle.get_image_labels' )
980980@mock .patch ('iib.workers.tasks.build_regenerate_bundle._write_related_bundles_file' )
981+ @mock .patch ('iib.workers.tasks.build_regenerate_bundle._resolve_image_pull_specs' )
981982def test_adjust_operator_bundle_duplicate_customizations_ordered (
982- mock_grbi , mock_gil , mock_aca , mock_gri , mock_apns , mock_gpa , tmpdir
983+ mock_rips , mock_grbi , mock_gil , mock_aca , mock_gri , mock_apns , mock_gpa , tmpdir
983984):
984985 manager = MagicMock ()
985986 manager .attach_mock (mock_gpa , 'mock_gpa' )
986987 manager .attach_mock (mock_apns , 'mock_apns' )
987- manager .attach_mock (mock_gri , 'mock_gri' )
988988 manager .attach_mock (mock_aca , 'mock_aca' )
989989 manager .attach_mock (mock_gil , 'mock_gil' )
990990 manager .attach_mock (mock_grbi , 'mock_grbi' )
@@ -1042,7 +1042,7 @@ def test_adjust_operator_bundle_duplicate_customizations_ordered(
10421042 registry = 'quay.io' ,
10431043 operator = 'operator' ,
10441044 image = '/image' ,
1045- ref = ':v1 ' ,
1045+ ref = '@sha256:654322 ' ,
10461046 related_name = f'image-{ image_digest } -annotation' ,
10471047 related_ref = '@sha256:749327' ,
10481048 )
@@ -1054,29 +1054,18 @@ def test_adjust_operator_bundle_duplicate_customizations_ordered(
10541054 )
10551055 csv3 .write (
10561056 csv_template .format (
1057- registry = 'registry.access.company.com' , operator = 'operator' , image = '/image' , ref = ':v2'
1057+ registry = 'registry.access.company.com' ,
1058+ operator = 'operator' ,
1059+ image = '/image' ,
1060+ ref = '@sha256:654321' ,
10581061 )
10591062 )
10601063
1061- def get_resolved_image (image ):
1062- return {
1063- 'quay.io/operator/image:v1' : 'quay.io/operator/image@sha256:654322' ,
1064- 'quay.io/operator/image:v2' : 'quay.io/operator/image@sha256:654321' ,
1065- 'quay.io/operator/image@sha256:654321' : 'quay.io/operator/image@sha256:654321' ,
1066- 'quay.io/operator/image@sha256:749327' : 'quay.io/operator/image@sha256:749327' ,
1067- 'registry.access.company.com/operator/image:v2' : (
1068- 'registry.access.company.com/operator/image@sha256:654321'
1069- ),
1070- }[image ]
1071-
1072- mock_gri .side_effect = get_resolved_image
1073-
10741064 labels = build_regenerate_bundle ._adjust_operator_bundle (
10751065 str (manifests_dir ), str (metadata_dir ), 1 , 'company-managed'
10761066 )
10771067
10781068 assert labels == {
1079- 'com.redhat.iib.pinned' : 'true' ,
10801069 'operators.operatorframework.io.bundle.package.v1' : 'amqstreams-cmp' ,
10811070 }
10821071 # Verify that the relatedImages are not modified if they were already set and that images were
@@ -1110,10 +1099,6 @@ def get_resolved_image(image):
11101099
11111100 expected_calls = [
11121101 call .mock_gpa (mock .ANY ),
1113- call .mock_gri (mock .ANY ),
1114- call .mock_gri (mock .ANY ),
1115- call .mock_gri (mock .ANY ),
1116- call .mock_gri (mock .ANY ),
11171102 call .mock_apns (mock .ANY , '-cmp' ),
11181103 call .mock_aca (mock .ANY , 'amqstreams' , annotations ),
11191104 call .mock_grbi (mock .ANY , 1 ),
@@ -1122,6 +1107,8 @@ def get_resolved_image(image):
11221107 call .mock_gil (mock .ANY ),
11231108 ]
11241109 assert manager .mock_calls == expected_calls
1110+ mock_rips .assert_not_called ()
1111+ mock_gri .assert_not_called ()
11251112
11261113
11271114@mock .patch ('iib.workers.tasks.build_regenerate_bundle.get_image_label' )
0 commit comments