Description of problem:
We have a pipeline to check if the sample-operator works well. But, I found the `oc import-image` commands always return 0 even if it fails.
MacBook-Pro:~ jianzhang$ oc import-image mytestimage --from=quay.io/openshifttest/busybox2@sha256:c5439d7db88ab5423999530349d327b04279ad3161d7596d2126dfb5b02bfd1f --confirm -n sample-test error: tag failed: Internal error occurred: quay.io/openshifttest/busybox2@sha256:c5439d7db88ab5423999530349d327b04279ad3161d7596d2126dfb5b02bfd1f: name unknown: repository not found imagestream.image.openshift.io/mytestimage imported with errors Name: mytestimage Namespace: sample-test Created: 4 minutes ago Labels: <none> Annotations: openshift.io/image.dockerRepositoryCheck=2022-11-30T02:53:29Z Image Repository: image-registry.openshift-image-registry.svc:5000/sample-test/mytestimage Image Lookup: local=false Unique Images: 0 Tags: 1 latest tagged from quay.io/openshifttest/busybox2@sha256:c5439d7db88ab5423999530349d327b04279ad3161d7596d2126dfb5b02bfd1f ! error: Import failed (InternalError): Internal error occurred: quay.io/openshifttest/busybox2@sha256:c5439d7db88ab5423999530349d327b04279ad3161d7596d2126dfb5b02bfd1f: name unknown: repository not found 4 minutes ago MacBook-Pro:~ jianzhang$ echo $? 0
Version-Release number of selected component (if applicable):
4.12
How reproducible:
always
Steps to Reproduce:
1. Install OCP 4.12 MacBook-Pro:~ jianzhang$ oc get clusterversion NAME VERSION AVAILABLE PROGRESSING SINCE STATUS version 4.12.0-0.nightly-2022-11-29-131548 True False 3h22m Cluster version is 4.12.0-0.nightly-2022-11-29-131548 2. Import an non-exit image. MacBook-Pro:~ jianzhang$ oc import-image mytestimage --from=quay.io/openshifttest/busybox2@sha256:c5439d7db88ab5423999530349d327b04279ad3161d7596d2126dfb5b02bfd1f --confirm -n sample-test error: tag failed: Internal error occurred: quay.io/openshifttest/busybox2@sha256:c5439d7db88ab5423999530349d327b04279ad3161d7596d2126dfb5b02bfd1f: name unknown: repository not found imagestream.image.openshift.io/mytestimage imported with errors Name: mytestimage Namespace: sample-test Created: 4 minutes ago Labels: <none> Annotations: openshift.io/image.dockerRepositoryCheck=2022-11-30T02:53:29Z Image Repository: image-registry.openshift-image-registry.svc:5000/sample-test/mytestimage Image Lookup: local=false Unique Images: 0 Tags: 1 latest tagged from quay.io/openshifttest/busybox2@sha256:c5439d7db88ab5423999530349d327b04279ad3161d7596d2126dfb5b02bfd1f ! error: Import failed (InternalError): Internal error occurred: quay.io/openshifttest/busybox2@sha256:c5439d7db88ab5423999530349d327b04279ad3161d7596d2126dfb5b02bfd1f: name unknown: repository not found 4 minutes ago 3. Check the return code.
Actual results:
It returns the succeed code 0, why? Any reason? Thanks!
MacBook-Pro:~ jianzhang$ echo $? 0
Expected results:
MacBook-Pro:~ jianzhang$ echo $? 1
Additional info:
Running Command: oc import-image mytestimage --from=quay.io/openshifttest/busybox@sha256:c5439d7db88ab5423999530349d327b04279ad3161d7596d2126dfb5b02bfd1f --confirm -n sample-test error: tag failed: Internal error occurred: [ec2-54-162-188-130.compute-1.amazonaws.com:6001/openshifttest/busybox@sha256:c5439d7db88ab5423999530349d327b04279ad3161d7596d2126dfb5b02bfd1f: Get "https://ec2-54-162-188-130.compute-1.amazonaws.com:6001/v2/": dial tcp 10.143.0.208:6001: connect: connection refused, quay.io/openshifttest/busybox@sha256:c5439d7db88ab5423999530349d327b04279ad3161d7596d2126dfb5b02bfd1f: Get "https://quay.io/v2/": dial tcp: lookup quay.io on 172.30.0.10:53: server misbehaving] imagestream.image.openshift.io/mytestimage imported with errors Name: mytestimage Namespace: sample-test Created: Less than a second ago Labels: <none> Annotations: openshift.io/image.dockerRepositoryCheck=2022-11-29T07:31:50Z Image Repository: image-registry.openshift-image-registry.svc:5000/sample-test/mytestimage Image Lookup: local=false Unique Images: 0 Tags: 1 latest tagged from quay.io/openshifttest/busybox@sha256:c5439d7db88ab5423999530349d327b04279ad3161d7596d2126dfb5b02bfd1f ! error: Import failed (InternalError): Internal error occurred: [ec2-54-162-188-130.compute-1.amazonaws.com:6001/openshifttest/busybox@sha256:c5439d7db88ab5423999530349d327b04279ad3161d7596d2126dfb5b02bfd1f: Get "https://ec2-54-162-188-130.compute-1.amazonaws.com:6001/v2/": dial tcp 10.143.0.208:6001: connect: connection refused, quay.io/openshifttest/busybox@sha256:c5439d7db88ab5423999530349d327b04279ad3161d7596d2126dfb5b02bfd1f: Get "https://quay.io/v2/": dial tcp: lookup quay.io on 172.30.0.10:53: server misbehaving] Less than a second ago