Merge pull request #933 from coreos-inc/gcsqlfix

Fix issue with query when manifest count is 0
This commit is contained in:
josephschorr 2015-11-19 17:47:43 -05:00
commit aa1911fe15

View file

@ -148,6 +148,8 @@ def garbage_collect_tags(repo):
.join(RepositoryTag) .join(RepositoryTag)
.where(RepositoryTag.id << tags_to_delete)) .where(RepositoryTag.id << tags_to_delete))
num_deleted_manifests = 0
if len(manifests_to_delete) > 0:
num_deleted_manifests = (TagManifest num_deleted_manifests = (TagManifest
.delete() .delete()
.where(TagManifest.id << manifests_to_delete) .where(TagManifest.id << manifests_to_delete)