message: file size check on sboms
diff: @@ -11,11 +11,24 @@ echo "Running sbom scan using syft"
  echo "Image being scanned: ${IMAGE_FULL}"
  set +x
  +
  DOCKER_HOST=docker-host.lagoon.svc docker run --rm -v /var/run/docker.sock:/var/run/docker.sock imagecache.amazeeio.cloud/anchore/syft packages ${IMAGE_FULL} -o ${SBOM_OUTPUT} | gzip > ${SBOM_OUTPUT_FILE}
  +# FILESIZE=$(stat -f%z "$IMAGE_FULL")
  +FILESIZE=$(stat -c%s "$SBOM_OUTPUT_FILE")
  +echo "Size of ${SBOM_OUTPUT_FILE} = $FILESIZE bytes."
  +
  +checkFileSizeLimit() {
  + if (( $FILESIZE > 950000 )); then
  + echo "$SBOM_OUTPUT_FILE is too large, skipping pushing to configmap"
  + return
  + fi
  +}
  +
  +checkFileSizeLimit
  +
  if [ -f "${SBOM_OUTPUT_FILE}" ]; then
  echo "Successfully generated SBOM for ${IMAGE_FULL}"
  -
  SBOM_CONFIGMAP=lagoon-sbom-${IMAGE_NAME}
  set -x
  