securityscanner: add a min image id option
This will enable us to force some instances of the securityworker to scan only new images.
This commit is contained in:
parent
aa2f88d321
commit
4ed0cdda14
4 changed files with 12 additions and 6 deletions
|
@ -495,10 +495,13 @@ def get_image_id():
|
|||
return Image.id
|
||||
|
||||
|
||||
def get_images_eligible_for_scan(clair_version):
|
||||
def get_images_eligible_for_scan(clair_version, min_id=None):
|
||||
""" Returns a query that gives all images eligible for a clair scan """
|
||||
return (get_image_with_storage_and_parent_base()
|
||||
.where(Image.security_indexed_engine < clair_version))
|
||||
query = (get_image_with_storage_and_parent_base()
|
||||
.where(Image.security_indexed_engine < clair_version))
|
||||
if min_id is not None:
|
||||
query = query.where(Image.id >= min_id)
|
||||
return query
|
||||
|
||||
|
||||
def get_image_with_storage_and_parent_base():
|
||||
|
|
Reference in a new issue