diff --git a/tasks/create-pyxis-image/create-pyxis-image.yaml b/tasks/create-pyxis-image/create-pyxis-image.yaml index 372e295a4..af50c1185 100644 --- a/tasks/create-pyxis-image/create-pyxis-image.yaml +++ b/tasks/create-pyxis-image/create-pyxis-image.yaml @@ -199,14 +199,15 @@ spec: EXPANDED_SIZE=$(wc --bytes "${BLOB_FILE}" | awk '{print $1}' | tr -d '\n') # Append this information to the parsed_data manifest - cat <<< $(jq \ + jq \ '.uncompressed_layers += [{"digest": "'"$EXPANDED_DIGEST"'", "size": '"$EXPANDED_SIZE"'}]' \ - "${MANIFEST_FILE}") > "${MANIFEST_FILE}" + "${MANIFEST_FILE}" > "${MANIFEST_FILE}.tmp" + mv "${MANIFEST_FILE}.tmp" "${MANIFEST_FILE}" # Clean up, in case we're dealing with large images rm "/tmp/oras-blob-fetch-${BLOB_DIGEST}" fi - done <<< $(jq -c '.layers[]' "${MANIFEST_FILE}") + done <<< "$(jq -c '.layers[]' "${MANIFEST_FILE}")" PYXIS_CERT_PATH=/tmp/crt PYXIS_KEY_PATH=/tmp/key create_container_image \ --pyxis-url $PYXIS_URL \