V1 Docker ID <-> V2 layer SHA mismatch fix

Fix handling of V1 Docker ID <-> V2 layer SHA mismatch by dynamically rewriting the manifest to use new synthesized IDs for all layers above the mismatch. Also adds a bunch of tests for this and other use cases, fixes a bug around manifest digest uniqueness and fixes the 5.5 migration for MySQL.
This commit is contained in:
Joseph Schorr 2016-02-12 17:39:27 +02:00
parent 8b61c69dad
commit abd2e3c234
6 changed files with 240 additions and 53 deletions

View file

@ -16,7 +16,7 @@ from datetime import datetime
def upgrade(tables):
### commands auto generated by Alembic - please adjust! ###
now = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
now = datetime.now().strftime("'%Y-%m-%d %H:%M:%S'")
op.add_column('blobupload', sa.Column('created', sa.DateTime(), nullable=False, server_default=sa.text(now)))
op.create_index('blobupload_created', 'blobupload', ['created'], unique=False)
### end Alembic commands ###

View file

@ -0,0 +1,28 @@
"""Remove uniqueness constraint on the TagManifest digest column
Revision ID: e4129c93e477
Revises: 956a0833223
Create Date: 2016-02-12 17:22:48.039791
"""
# revision identifiers, used by Alembic.
revision = 'e4129c93e477'
down_revision = '956a0833223'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
def upgrade(tables):
### commands auto generated by Alembic - please adjust! ###
op.drop_index('tagmanifest_digest', table_name='tagmanifest')
op.create_index('tagmanifest_digest', 'tagmanifest', ['digest'], unique=False)
### end Alembic commands ###
def downgrade(tables):
### commands auto generated by Alembic - please adjust! ###
op.drop_index('tagmanifest_digest', table_name='tagmanifest')
op.create_index('tagmanifest_digest', 'tagmanifest', ['digest'], unique=True)
### end Alembic commands ###