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

After retries are exhausted `resp.status_code` is printed, but doesn't exist #65

Closed ffalor closed 1 year ago

ffalor commented 1 year ago
Log

``` INFO Tagging 'crowdstrike/crowdstrike-container-extension:latest' to 'container-upload.us-2.crowdstrike.com/crowdstrike/crowdstrike-container-extension:latest' INFO Performing login to CrowdStrike Image Assessment Service INFO Login Succeeded INFO Performing container push to ***/crowdstrike/crowdstrike-container-extension:latest INFO Docker: The push refers to repository [***/crowdstrike/crowdstrike-container-extension] INFO Docker: Preparing INFO Docker: Preparing INFO Docker: Preparing INFO Docker: Preparing INFO Docker: Preparing INFO Docker: Preparing INFO Docker: Waiting INFO Docker: Layer already exists INFO Docker: Layer already exists INFO Docker: Layer already exists INFO Docker: Layer already exists INFO Docker: Layer already exists ] 269.3kB/6.557MB', None] INFO Docker: Pushed=======================================>] 6.565MB', None]', None] INFO Docker: latest: digest: sha256:91bc5a9c93162e3b24bfc9461798a574b5e2ee1531a79cea56f080115686c3ff size: 1572 INFO Downloading Image Scan Report INFO Scan report is not ready yet, retrying in 10 seconds INFO Scan report is not ready yet, retrying in 10 seconds INFO Scan report is not ready yet, retrying in 10 seconds INFO Scan report is not ready yet, retrying in 10 seconds INFO Scan report is not ready yet, retrying in 10 seconds INFO Scan report is not ready yet, retrying in 10 seconds INFO Scan report is not ready yet, retrying in 10 seconds INFO Scan report is not ready yet, retrying in 10 seconds INFO Scan report is not ready yet, retrying in 10 seconds INFO Scan report is not ready yet, retrying in 10 seconds 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' ```