v2: add logs around InvalidManifest exception
This commit is contained in:
parent
6c6ef0f22a
commit
afa220a744
1 changed files with 4 additions and 0 deletions
|
@ -100,6 +100,7 @@ def write_manifest_by_tagname(namespace_name, repo_name, manifest_ref):
|
||||||
try:
|
try:
|
||||||
manifest = DockerSchema1Manifest(request.data)
|
manifest = DockerSchema1Manifest(request.data)
|
||||||
except ManifestException as me:
|
except ManifestException as me:
|
||||||
|
logger.exception("failed to parse manifest when writing by tagname")
|
||||||
raise ManifestInvalid(detail={'message': 'failed to parse manifest: %s' % me.message})
|
raise ManifestInvalid(detail={'message': 'failed to parse manifest: %s' % me.message})
|
||||||
|
|
||||||
if manifest.tag != manifest_ref:
|
if manifest.tag != manifest_ref:
|
||||||
|
@ -118,6 +119,7 @@ def write_manifest_by_digest(namespace_name, repo_name, manifest_ref):
|
||||||
try:
|
try:
|
||||||
manifest = DockerSchema1Manifest(request.data)
|
manifest = DockerSchema1Manifest(request.data)
|
||||||
except ManifestException as me:
|
except ManifestException as me:
|
||||||
|
logger.exception("failed to parse manifest when writing by digest")
|
||||||
raise ManifestInvalid(detail={'message': 'failed to parse manifest: %s' % me.message})
|
raise ManifestInvalid(detail={'message': 'failed to parse manifest: %s' % me.message})
|
||||||
|
|
||||||
if manifest.digest != manifest_ref:
|
if manifest.digest != manifest_ref:
|
||||||
|
@ -143,6 +145,7 @@ def _write_manifest(namespace_name, repo_name, manifest):
|
||||||
raise NameInvalid()
|
raise NameInvalid()
|
||||||
|
|
||||||
if not manifest.layers:
|
if not manifest.layers:
|
||||||
|
logger.info("manifest provided with no layers")
|
||||||
raise ManifestInvalid(detail={'message': 'manifest does not reference any layers'})
|
raise ManifestInvalid(detail={'message': 'manifest does not reference any layers'})
|
||||||
|
|
||||||
# Ensure all the blobs in the manifest exist.
|
# Ensure all the blobs in the manifest exist.
|
||||||
|
@ -172,6 +175,7 @@ def _write_manifest(namespace_name, repo_name, manifest):
|
||||||
rewritten_image.parent_image_id,
|
rewritten_image.parent_image_id,
|
||||||
)
|
)
|
||||||
except ManifestException as me:
|
except ManifestException as me:
|
||||||
|
logger.exception("exception when rewriting v1 metadata")
|
||||||
raise ManifestInvalid(detail={'message': 'failed synthesizing v1 metadata: %s' % me.message})
|
raise ManifestInvalid(detail={'message': 'failed synthesizing v1 metadata: %s' % me.message})
|
||||||
|
|
||||||
# Store the manifest pointing to the tag.
|
# Store the manifest pointing to the tag.
|
||||||
|
|
Reference in a new issue