Fix a bug in manifest backfill that made it only work on active tags

This commit is contained in:
Joseph Schorr 2019-01-21 16:42:24 -05:00
parent cb637e1233
commit 0035a1ec6d
3 changed files with 7 additions and 8 deletions

View file

@ -726,9 +726,7 @@ def get_possibly_expired_tag(namespace, repo_name, tag_name):
.where(RepositoryTag.name == tag_name, Repository.name == repo_name,
Namespace.username == namespace)).get()
def associate_generated_tag_manifest(namespace, repo_name, tag_name, manifest, storage_id_map):
tag = get_active_tag(namespace, repo_name, tag_name)
def associate_generated_tag_manifest_with_tag(tag, manifest, storage_id_map):
try:
manifest = TagManifest.get(digest=manifest.digest)
manifest.tag = tag
@ -744,7 +742,7 @@ def associate_generated_tag_manifest(namespace, repo_name, tag_name, manifest, s
.join(TagToRepositoryTag)
.where(TagToRepositoryTag.repository_tag == tag)).get()
except Tag.DoesNotExist:
oci_tag = Tag.create(repository=tag.repository, manifest=oci_manifest, name=tag_name,
oci_tag = Tag.create(repository=tag.repository, manifest=oci_manifest, name=tag.name,
reversion=tag.reversion,
lifetime_start_ms=tag.lifetime_start_ts * 1000,
lifetime_end_ms=(tag.lifetime_end_ts * 1000