Allow the namespace column to be null, and also non-unique. Fix the uncompressed size clobbering the size on the wire field. Add metadata constraints so that foreign key constraints get predictable names. Fix all downgrade migrations.
This commit is contained in:
parent
2c5cc7990f
commit
5c18ffe67d
9 changed files with 53 additions and 28 deletions
|
@ -220,7 +220,7 @@ def put_image_layer(namespace, repository, image_id):
|
|||
image_size = tmp.tell()
|
||||
|
||||
# Save the size of the image.
|
||||
model.set_image_size(image_id, namespace, repository, image_size)
|
||||
model.set_image_size(image_id, namespace, repository, image_size, uncompressed_size_info.size)
|
||||
|
||||
tmp.seek(0)
|
||||
csums.append(checksums.compute_tarsum(tmp, json_data))
|
||||
|
@ -229,12 +229,6 @@ def put_image_layer(namespace, repository, image_id):
|
|||
logger.debug('put_image_layer: Error when computing tarsum '
|
||||
'{0}'.format(e))
|
||||
|
||||
# Write the uncompressed image size, if any.
|
||||
if uncompressed_size_info['size'] > 0:
|
||||
profile.debug('Storing uncompressed layer size: %s' % uncompressed_size_info['size'])
|
||||
repo_image.storage.uncompressed_size = uncompressed_size_info['size']
|
||||
repo_image.storage.save()
|
||||
|
||||
if repo_image.storage.checksum is None:
|
||||
# We don't have a checksum stored yet, that's fine skipping the check.
|
||||
# Not removing the mark though, image is not downloadable yet.
|
||||
|
|
Reference in a new issue