Merge pull request #1221 from coreos-inc/secworkerfixes

various securityworker fixes
This commit is contained in:
Quentin Machu 2016-02-09 22:29:55 -05:00
commit 86584abba5

View file

@ -18,8 +18,8 @@ from util.secscan.api import SecurityConfigValidator
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
BATCH_SIZE = 5 BATCH_SIZE = 50
INDEXING_INTERVAL = 60 INDEXING_INTERVAL = 30
API_METHOD_INSERT = '/v1/layers' API_METHOD_INSERT = '/v1/layers'
API_METHOD_VERSION = '/v1/versions/engine' API_METHOD_VERSION = '/v1/versions/engine'
@ -116,7 +116,7 @@ class SecurityWorker(Worker):
# Hopefully, there is no version lower than the target one running # Hopefully, there is no version lower than the target one running
set_secscan_status(image, False, self._target_version) set_secscan_status(image, False, self._target_version)
return True return False
else: else:
logger.warning('Got non-201 when analyzing layer ID %s: %s', request['ID'], jsonResponse) logger.warning('Got non-201 when analyzing layer ID %s: %s', request['ID'], jsonResponse)
return False return False
@ -172,7 +172,7 @@ class SecurityWorker(Worker):
# Analyze the image. # Analyze the image.
analyzed = self._analyze_image(image) analyzed = self._analyze_image(image)
if not analyzed: if not analyzed:
return continue
# Get the tags of the image we analyzed # Get the tags of the image we analyzed
matching = list(filter_tags_have_repository_event(get_tags_for_image(image.id), event)) matching = list(filter_tags_have_repository_event(get_tags_for_image(image.id), event))