Change manifest delete to mark tag as dead and log

This commit is contained in:
Joseph Schorr 2015-12-10 15:15:24 -05:00
parent 5ff3ec631e
commit d963f7174a
3 changed files with 29 additions and 2 deletions

View file

@ -388,9 +388,15 @@ def delete_manifest_by_digest(namespace, repo_name, manifest_ref):
# Without a tag name to reference, we can't make an attempt to generate the manifest
raise ManifestUnknown()
manifest.delete_instance()
# Mark the tag as no longer alive.
try:
model.tag.delete_tag(namespace, repo_name, manifest.tag.name)
except model.DataModelException:
# Tag is not alive.
raise ManifestUnknown()
# TODO(jschorr): Log this as a new log type.
track_and_log('delete_tag', manifest.tag.repository,
tag=manifest.tag.name, digest=manifest_ref)
return make_response('', 202)