@@ -67,7 +67,6 @@ SUPPLIER_NAME=dockerhub
6767SUPPLIER_URL=https://hub.docker.com
6868TOOL_VENDOR=" Jitsuin Inc"
6969TOOL_HASH_ALG=SHA-256
70- SBOM_UPLOAD_TIMEOUT=10
7170# shellcheck disable=SC2002
7271TOOL_HASH_CONTENT=$( shasum -a 256 " $0 " | cut -d' ' -f1)
7372# credentials directory should have 0700 permissions
@@ -367,32 +366,17 @@ EOF
367366# ----------------------------------------------------------------------------
368367log " Upload ${PRIVACY} ${OUTPUT} ..."
369368
370- HTTP_STATUS=$( timeout ${SBOM_UPLOAD_TIMEOUT} \
371- curl -s -w " %{http_code}" -X POST \
369+ HTTP_STATUS=$( curl -s -w " %{http_code}" -X POST \
372370 -o " ${TEMPDIR} /upload" \
373371 -H " @${BEARER_TOKEN_FILE} " \
374372 -H " content_type=text/xml" \
375373 -F " sbom=@${PATCHED_OUTPUT} " \
376374 " ${URL} /archivist/v1/sboms?privacy=${PRIVACY} " )
377375
378- RETURN_CODE=$?
379-
380- # timeout returns 124 if the command exceeded the time limit
381- if [ ${RETURN_CODE} -eq 124 ]
382- then
383- log " Upload failure: Timeout"
384- exit 3
385- # all other non-zero return codes
386- elif [ ${RETURN_CODE} -gt 0 ]
387- then
388- log " Upload failure: Error code ${RETURN_CODE} "
389- exit 4
390- fi
391-
392376if [ " ${HTTP_STATUS} " != " 200" ]
393377then
394- log " Upload failure: HTTP ${HTTP_STATUS} "
395- exit 5
378+ log " Upload failure ${HTTP_STATUS} "
379+ exit 4
396380fi
397381log " Upload success: "
398382jq . " ${TEMPDIR} /upload"
0 commit comments