Make sure images in the process of being uploaded are not scanned by Clair

This commit is contained in:
Joseph Schorr 2019-02-08 16:20:44 -05:00
parent 8d722dee81
commit 0b706bc7c4
3 changed files with 11 additions and 1 deletions

View file

@ -104,6 +104,14 @@ class LayerAnalyzer(object):
# Nothing more to do.
return
# Make sure the image's storage is not marked as uploading. If so, nothing more to do.
if layer.storage.uploading:
if not set_secscan_status(layer, False, self._target_version):
raise PreemptedException
# Nothing more to do.
return
# Analyze the image.
previously_security_indexed_successfully = layer.security_indexed
previous_security_indexed_engine = layer.security_indexed_engine