Add a uniqueness hash to derived image storage to break caching over tags

This allows converted ACIs and squashed images to be unique based on the specified tag.

Fixes #92
This commit is contained in:
Joseph Schorr 2016-06-06 15:38:29 -04:00
parent a33a70a419
commit a43b741f1b
7 changed files with 119 additions and 40 deletions

View file

@ -617,12 +617,13 @@ class DerivedStorageForImage(BaseModel):
source_image = ForeignKeyField(Image)
derivative = ForeignKeyField(ImageStorage)
transformation = ForeignKeyField(ImageStorageTransformation)
uniqueness_hash = CharField(null=True)
class Meta:
database = db
read_slaves = (read_slave,)
indexes = (
(('source_image', 'transformation'), True),
(('source_image', 'transformation', 'uniqueness_hash'), True),
)