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:
Jimmy Zelinskie 2017-03-03 13:55:25 -05:00
parent aa2f88d321
commit 4ed0cdda14
4 changed files with 12 additions and 6 deletions

View file

@ -42,7 +42,7 @@ class SecurityWorker(Worker):
def _index_images(self):
def batch_query():
return get_images_eligible_for_scan(self._target_version)
return get_images_eligible_for_scan(self._target_version, app.config.get('SECURITY_SCANNER_INDEXING_MIN_ID', None))
# Get the ID of the last image we can analyze. Will be None if there are no images in the
# database.