Garbage collect repositories on push and on tag deletion.

This commit is contained in:
yackob03 2014-02-06 14:13:35 -05:00
parent 732ce83795
commit ef68982728
3 changed files with 38 additions and 16 deletions

View file

@ -222,6 +222,8 @@ def update_images(namespace, repository):
updated_tags[image['Tag']] = image['id']
model.set_image_checksum(image['id'], repo, image['checksum'])
num_removed = model.garbage_collect_repository(namespace, repository)
# Generate a job for each webhook that has been added to this repo
webhooks = model.list_webhooks(namespace, repository)
for webhook in webhooks:
@ -237,7 +239,8 @@ def update_images(namespace, repository):
'homepage': 'https://quay.io/repository/%s' % repo_string,
'visibility': repo.visibility.name,
'updated_tags': updated_tags,
'pushed_image_count': len(image_with_checksums),
'pushed_image_count': len(image_with_checksums),
'pruned_image_count': num_removed,
}
webhook_queue.put(json.dumps(webhook_data))