Merge pull request #1326 from coreos-inc/secworkererror
Make analyzer handle images without features or vulnerabilities
This commit is contained in:
commit
2c7aae10a9
1 changed files with 2 additions and 2 deletions
|
@ -113,7 +113,7 @@ class LayerAnalyzer(object):
|
||||||
if layer_data is not None:
|
if layer_data is not None:
|
||||||
# Dispatch events for any detected vulnerabilities
|
# Dispatch events for any detected vulnerabilities
|
||||||
logger.debug('Got data for layer %s: %s', layer.id, layer_data)
|
logger.debug('Got data for layer %s: %s', layer.id, layer_data)
|
||||||
found_features = layer_data['Layer']['Features']
|
found_features = layer_data['Layer'].get('Features', [])
|
||||||
for repository_id in repository_map:
|
for repository_id in repository_map:
|
||||||
tags = repository_map[repository_id]
|
tags = repository_map[repository_id]
|
||||||
|
|
||||||
|
@ -121,7 +121,7 @@ class LayerAnalyzer(object):
|
||||||
if 'Vulnerabilities' not in feature:
|
if 'Vulnerabilities' not in feature:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
for vulnerability in feature['Vulnerabilities']:
|
for vulnerability in feature.get('Vulnerabilities', []):
|
||||||
event_data = {
|
event_data = {
|
||||||
'tags': [tag.name for tag in tags],
|
'tags': [tag.name for tag in tags],
|
||||||
'vulnerability': {
|
'vulnerability': {
|
||||||
|
|
Reference in a new issue