Description of problem:
When I execute the following two tag commands in a row on OCP 4.14.0-ec.3, Multi-Arch: oc tag $IMAGE@$DIGEST_MANIFEST test-1:tag-manifest sleep 0 oc tag $IMAGE@$DIGEST_MANIFEST test-1:tag-manifest-preserve-original --import-mode=PreserveOriginal Then wrong data is written to the .image.dockerImageMetadata record. If there is a delay between these two commands, e.g. sleep 5, then the image.dockerImageMetadata contains correct data.
Version-Release number of selected component (if applicable):
How reproducible:
Run the below script and you see the error. If you change the SLEEP_TIME=5, then the script passes. No problem.
Steps to Reproduce:
#!/usr/bin/env bash set -e SLEEP_TIME=0 # Test will fail, when sleep time is 0, use delay of 3 sec or more to pass this test IMAGE="quay.io/podman/hello" podman pull $IMAGE:latest DIGEST_MANIFEST=$(podman inspect quay.io/podman/hello:latest | jq -r '.[0].Digest') oc new-project "ir-test-001" oc create imagestream test-1 oc import-image test-1 --from="${IMAGE}@${DIGEST_MANIFEST}" --import-mode='PreserveOriginal' oc tag $IMAGE@$DIGEST_MANIFEST test-1:tag-manifest sleep "${SLEEP_TIME}" oc tag $IMAGE@$DIGEST_MANIFEST test-1:tag-manifest-preserve-original --import-mode=PreserveOriginal sleep 5 [[ $(oc get istag test-1:tag-manifest-preserve-original -o json | jq -r '.image.dockerImageMetadata.Architecture') == "null" ]] && echo "pass: tag-manifest-preserve-original has no architecture" || echo "fail: tag-preserve-original has architecture and should not"
Actual results:
fail: tag-preserve-original has architecture and should not oc get istag test-1:tag-manifest-preserve-original -o json | jq -r '.image.dockerImageMetadata.Architecture' amd64
Expected results:
pass: tag-manifest-preserve-original has no architecture oc get istag test-1:tag-manifest-preserve-original -o json | jq -r '.image.dockerImageMetadata.Architecture' null
Additional info:
This was tested with OC command on x86_64