Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.

Commit

Permalink
Check for returned mediatype from the registry
Browse files Browse the repository at this point in the history
  • Loading branch information
ipanova committed Feb 12, 2019
1 parent 9d72e94 commit a7f704f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions plugins/pulp_docker/plugins/importers/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,10 @@ def _process_manifest_list(self, manifest_list, digest, available_blobs, tag):
# for compatibility with older clients, try to fetch schema1 in case it is available
# we set the headers to False in order to get the conversion to schema1
manifests = self.parent.index_repository.get_manifest(tag, headers=False, tag=True)
manifest, digest, _ = manifests[0]
self._process_manifest(manifest, digest, available_blobs, tag=tag)
manifest, digest, content_type = manifests[0]
if content_type in (constants.MEDIATYPE_MANIFEST_S1,
constants.MEDIATYPE_SIGNED_MANIFEST_S1):
self._process_manifest(manifest, digest, available_blobs, tag=tag)
except IOError as e:
if str(e) != 'Not Found':
raise
Expand Down
2 changes: 1 addition & 1 deletion plugins/test/unit/plugins/importers/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def test_process_manifest_list(self, from_json, mock_manifest):
os='linux',
arch='arm')]
self.assertEqual(step.parent.available_manifests[0].manifests, expected_man)
self.assertEqual(mock_manifest.call_count, 3)
self.assertEqual(mock_manifest.call_count, 2)
self.assertEqual(step.parent.index_repository.get_manifest.call_count, 3)
self.assertEqual(len(step.parent.save_tags_step.tagged_manifests), 1)

Expand Down

0 comments on commit a7f704f

Please sign in to comment.