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,10 +148,12 @@ def garbage_collect_tags(repo):
.join(RepositoryTag)
.where(RepositoryTag.id << tags_to_delete))
num_deleted_manifests = (TagManifest
.delete()
.where(TagManifest.id << manifests_to_delete)
.execute())
num_deleted_manifests = 0
if len(manifests_to_delete) > 0:
num_deleted_manifests = (TagManifest
.delete()
.where(TagManifest.id << manifests_to_delete)
.execute())
num_deleted_tags = (RepositoryTag
.delete()