WIP: Towards sec demo

This commit is contained in:
Joseph Schorr 2015-10-27 17:38:48 -04:00 committed by Jimmy Zelinskie
parent fb3d0fa27d
commit 407eaae137
6 changed files with 164 additions and 14 deletions

View file

@ -12,6 +12,16 @@ def _tag_alive(query, now_ts=None):
(RepositoryTag.lifetime_end_ts > now_ts))
def get_matching_tags(docker_image_ids, *args):
""" Returns a query pointing to all tags that contain the given image(s). """
return (RepositoryTag
.select(*args)
.distinct()
.join(Image)
.where(Image.id << image.get_repository_images_recursive(docker_image_ids),
RepositoryTag.lifetime_end_ts >> None))
def list_repository_tags(namespace_name, repository_name, include_hidden=False,
include_storage=False):
to_select = (RepositoryTag, Image)