Merge branch 'master' of ssh://bitbucket.org/yackob03/quay
This commit is contained in:
commit
4af2a30a45
1 changed files with 11 additions and 1 deletions
|
@ -96,6 +96,16 @@ def resolve_or_create(repo, docker_image_id, new_ancestry):
|
||||||
raise RuntimeError()
|
raise RuntimeError()
|
||||||
|
|
||||||
|
|
||||||
|
def all_ancestors_exist(ancestors):
|
||||||
|
if not ancestors:
|
||||||
|
return True
|
||||||
|
|
||||||
|
found_count = len(list(Image
|
||||||
|
.select()
|
||||||
|
.where(Image.id << ancestors)))
|
||||||
|
return found_count == len(ancestors)
|
||||||
|
|
||||||
|
|
||||||
cant_fix = []
|
cant_fix = []
|
||||||
for img in query:
|
for img in query:
|
||||||
try:
|
try:
|
||||||
|
@ -111,7 +121,7 @@ for img in query:
|
||||||
ancestor_dbids = [int(anc_id)
|
ancestor_dbids = [int(anc_id)
|
||||||
for anc_id in img.ancestors.split('/')[1:-1]]
|
for anc_id in img.ancestors.split('/')[1:-1]]
|
||||||
|
|
||||||
if len(full_ancestry) != len(ancestor_dbids):
|
if len(full_ancestry) != len(ancestor_dbids) or not all_ancestors_exist(ancestor_dbids):
|
||||||
logger.error('Image has incomplete ancestry: %s, %s, %s, %s' %
|
logger.error('Image has incomplete ancestry: %s, %s, %s, %s' %
|
||||||
(img.id, img.docker_image_id, full_ancestry,
|
(img.id, img.docker_image_id, full_ancestry,
|
||||||
ancestor_dbids))
|
ancestor_dbids))
|
||||||
|
|
Reference in a new issue