Make sure list_manifest_layers is not callable for manifest lists
This commit is contained in:
parent
7fa60d5802
commit
a9b8586423
3 changed files with 10 additions and 6 deletions
|
@ -58,10 +58,12 @@ def _manifest_dict(manifest):
|
|||
if manifest.legacy_image_if_present is not None:
|
||||
image = image_dict(manifest.legacy_image, with_history=True)
|
||||
|
||||
layers = registry_model.list_manifest_layers(manifest, storage)
|
||||
if layers is None and not manifest.is_manifest_list:
|
||||
logger.debug('Missing layers for manifest `%s`', manifest.digest)
|
||||
abort(404)
|
||||
layers = None
|
||||
if not manifest.is_manifest_list:
|
||||
layers = registry_model.list_manifest_layers(manifest, storage)
|
||||
if layers is None:
|
||||
logger.debug('Missing layers for manifest `%s`', manifest.digest)
|
||||
abort(404)
|
||||
|
||||
return {
|
||||
'digest': manifest.digest,
|
||||
|
|
Reference in a new issue