Skip to content
This repository was archived by the owner on Sep 12, 2018. It is now read-only.

Commit 2d172a9

Browse files
author
Andy Goldstein
committed
Add image to tag_deleted signal payload
Add image to tag_deleted signal payload. This is useful for things such as a refcount extension, which needs to know the image that was associated with the deleted tag so refcounts can be updated accordingly.
1 parent 3fcd90e commit 2d172a9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

docker_registry/tags.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,14 +208,17 @@ def put_tag(namespace, repository, tag):
208208
def delete_tag(namespace, repository, tag):
209209
logger.debug("[delete_tag] namespace={0}; repository={1}; tag={2}".format(
210210
namespace, repository, tag))
211-
store.remove(store.tag_path(namespace, repository, tag))
211+
tag_path = store.tag_path(namespace, repository, tag)
212+
image = store.get_content(path=tag_path)
213+
store.remove(tag_path)
212214
store.remove(store.repository_tag_json_path(namespace, repository,
213215
tag))
214216
sender = flask.current_app._get_current_object()
215217
if tag == "latest": # TODO(wking) : deprecate this for v2
216218
store.remove(store.repository_json_path(namespace, repository))
217219
signals.tag_deleted.send(
218-
sender, namespace=namespace, repository=repository, tag=tag)
220+
sender, namespace=namespace, repository=repository, tag=tag,
221+
image=image)
219222

220223

221224
@app.route('/v1/repositories/<path:repository>/tags/<tag>',

0 commit comments

Comments
 (0)