Allow tags to be marked as hidden. Create a hidden tag on every image during a push to prevent them from getting GCed.

This commit is contained in:
Jake Moshenko 2015-02-18 16:37:38 -05:00
parent 04b06547b8
commit 41108a0856
6 changed files with 63 additions and 14 deletions

View file

@ -467,6 +467,10 @@ def put_image_json(namespace, repository, image_id):
repo_image = model.find_create_or_link_image(image_id, repo, username, {},
store.preferred_locations[0])
# Create a temporary tag to prevent this image from getting garbage collected while the push
# is in progress.
model.create_temporary_hidden_tag(repo, repo_image, app.config['PUSH_TEMP_TAG_EXPIRATION_S'])
uuid = repo_image.storage.uuid
if image_id != data['id']: