Revert "Merge pull request #2844 from coreos-inc/alegrand/use_latest_appr_server_code"

This reverts commit 646fafb2fd, reversing
changes made to 5c1b635439.
This commit is contained in:
Jimmy Zelinskie 2017-08-09 20:45:46 -04:00
parent 49df658e20
commit 9e09612851
16 changed files with 68 additions and 106 deletions

View file

@ -1,35 +0,0 @@
"""add_mediatypes
Revision ID: 5d4ae648155c
Revises: d8989249f8f6
Create Date: 2017-08-04 16:01:47.573800
"""
# revision identifiers, used by Alembic.
revision = '5d4ae648155c'
down_revision = 'd8989249f8f6'
from alembic import op
import sqlalchemy as sa
def upgrade(tables):
mtypes = ['helm', 'kpm', 'docker-compose', 'ksonnet', 'appr', 'kubernetes']
data = []
for mtype in mtypes:
data.append({'name': 'application/vnd.appr.package-manifest.%s.v0.json' % mtype})
data.append({'name': 'application/vnd.appr.package.%s.v0.tar+gzip' % mtype})
op.bulk_insert(
tables.mediatype,
[
{'name': 'application/vnd.appr.blob.v0.tar+gzip'},
{'name': 'application/vnd.appr.manifests.v0.json'},
{'name': 'application/vnd.appr.manifest.list.v0.json'},
] + data,
)
def downgrade(tables):
pass

View file

@ -2,7 +2,7 @@ import logging
import hashlib
import json
from appr.models.package_base import get_media_type
from cnr.models.package_base import get_media_type
from data.database import db_transaction, Manifest, ManifestListManifest, MediaType, Blob, Tag
from data.oci_model import tag as tag_model

View file

@ -1,4 +1,4 @@
from appr.models.package_base import get_media_type, manifest_media_type
from cnr.models.package_base import get_media_type, manifest_media_type
from peewee import prefetch

View file

@ -1,7 +1,7 @@
import bisect
from appr.exception import PackageAlreadyExists
from appr.models.package_base import manifest_media_type
from cnr.exception import PackageAlreadyExists
from cnr.models.package_base import manifest_media_type
from data.database import (db_transaction, get_epoch_timestamp, Manifest, ManifestList, Tag,
ManifestListManifest, Blob, ManifestBlob)
@ -10,7 +10,6 @@ from data.oci_model import (blob as blob_model, manifest as manifest_model,
tag as tag_model)
# @TODO(ant31): cnr for retro-compat prepare a data migration
LIST_MEDIA_TYPE = 'application/vnd.cnr.manifest.list.v0.json'
SCHEMA_VERSION = 'v0'
@ -104,7 +103,7 @@ def create_app_release(repo, tag_name, manifest_data, digest, force=False):
list_json.insert(insert_point, manifest.manifest_json)
list_manifest_ids.insert(insert_point, manifest.id)
manifestlist = manifest_list_model.get_or_create_manifest_list(list_json, LIST_MEDIA_TYPE,
SCHEMA_VERSION)
SCHEMA_VERSION)
manifest_list_model.create_manifestlistmanifest(manifestlist, list_manifest_ids, list_json)
tag = tag_model.create_or_update_tag(repo, tag_name, manifest_list=manifestlist,

View file

@ -1,6 +1,6 @@
import logging
from appr.models.package_base import manifest_media_type
from cnr.models.package_base import manifest_media_type
from peewee import IntegrityError
from data.model import (db_transaction, TagAlreadyCreatedException)