CrowdStrike / container-image-scan

Code to scan a container with CrowdStrike and return response codes indicating pass/fail status.
MIT License
35 stars 23 forks source link

error properly when retries are exhausted #68

Closed ffalor closed 1 year ago

ffalor commented 1 year ago

Fixes #65 Previous error:

ERROR   Retries exhausted
ERROR   Unknown error
Traceback (most recent call last):
  File "/app/cs_imagescan.py", line 368, in main
    scan_report = scan_image.get_scanreport(retry_count)
  File "/app/cs_imagescan.py", line 142, in get_scanreport
    raise APIError('GET {}'.format(resp.status_code))
AttributeError: 'dict' object has no attribute 'status_code'

New error:

ERROR   Retries exhausted
Traceback (most recent call last):
  File "/workspaces/container-image-scan/cs_scanimage.py", line 480, in main
    scan_report = scan_image.get_scanreport(retry_count)
  File "/workspaces/container-image-scan/cs_scanimage.py", line 168, in get_scanreport
    raise RetryExhaustedError(
RetryExhaustedError: Report was not completed after 1 retries. Use -R or --retry_count to increase the number of retries
redhatrises commented 1 year ago

Ack. Thanks!