Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-4280

Return 0 when `oc import-image` failed

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Undefined
    • None
    • 4.12.0
    • oc
    • None
    • False
    • Hide

      None

      Show
      None
    • NA
    • Bug Fix

    Description

      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:

      https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/origin-ci-test/pr-logs/pull/openshift_release/34311/rehearse-34311-periodic-ci-openshift-verification-tests-master-installer-rehearse-4.11-installer-rehearse-aws-c2s/1597474073825251328/artifacts/installer-rehearse-aws-c2s/set-sample-operator-disconnected/build-log.txt 

      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

      Attachments

        Activity

          People

            aguclu@redhat.com Arda Guclu
            rhn-support-jiazha Jian Zhang
            xiujuan wang xiujuan wang
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: