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

oc-mirror enters into infinite loop when size of images to copy is zero

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • 4.18.0
    • oc-mirror
    • None
    • Important
    • None
    • CLID Sprint 266
    • 1
    • False
    • Hide

      None

      Show
      None
    • Release Note Not Required
    • In Progress

      Description of problem:

      When there are no images for copying or size of images to copy is zero oc-mirror enters into infinite loop as shown below
      
      {code:java}
      [fedora@knarra-fedora knarra]$ ./oc-mirror -c /tmp/iscoci.yaml file://test --v2 --cache-dir /test/yinzhou
      
      2025/01/31 17:25:34  [INFO]   : :wave: Hello, welcome to oc-mirror
      2025/01/31 17:25:34  [INFO]   : :gear:  setting up the environment for you...
      2025/01/31 17:25:34  [INFO]   : :twisted_rightwards_arrows: workflow mode: mirrorToDisk 
      2025/01/31 17:25:34  [INFO]   : 🕵  going to discover the necessary images...
      2025/01/31 17:25:34  [INFO]   : :mag: collecting release images...
      2025/01/31 17:25:34  [INFO]   : :mag: collecting operator images...
       ✗   () Collecting catalog oci:///home/fedora/knarra/openshift-tests-private/redhat-operator-index 
      2025/01/31 17:25:34  [WARN]   : [OperatorImageCollector] catalog invalid source name oci:///home/fedora/knarra/openshift-tests-private/redhat-operator-index: lstat /home/fedora/knarra/openshift-tests-private: no such file or directory : SKIPPING
      2025/01/31 17:25:34  [INFO]   : :mag: collecting additional images...
      2025/01/31 17:25:34  [INFO]   : :mag: collecting helm images...
      2025/01/31 17:25:34  [INFO]   : :repeat_one: rebuilding catalogs
      2025/01/31 17:25:34  [INFO]   : :rocket: Start copying the images...
      207712134 / 0 (7m56s) [------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------] 0 %
      
          Version-Release number of selected component (if applicable):{code:none}
           4.18
          

      How reproducible:

           Always
          

      Steps to Reproduce:

          1. Run the command to copy redhat-operator-index as an oci file by using command skopeo copy --all docker://registry.redhat.io/redhat/redhat-operator-index:v4.16 --remove-signatures --insecure-policy oci:///home/fedora/knarra/redhat-operator-index
          2. Now create imageSetConfig.yaml as shown below
      
      {code:java}
      kind: ImageSetConfiguration
      apiVersion: mirror.openshift.io/v2alpha1
      mirror:
        operators:
          - catalog: oci:///home/fedora/knarra/openshift-tests-private/redhat-operator-index
            targetCatalog: "ocicatalog73452"
            targetTag: "v16"
            packages:
              - name: cluster-kube-descheduler-operator
      

      3. Run command oc-mirror -c /tmp/iscoci.yaml file://test --v2 --cache-dir /test/yinzhou

          Actual results:{code:none}
          You can see that mirroring enters into infinite loop
          

      Expected results:

           Mirroring should fail since there is no such directory and come out.
          

      Additional info:

          https://redhat-internal.slack.com/archives/C050P27C71S/p1738344713804659
          

              rh-ee-aguidi Alex Guidi
              knarra@redhat.com Rama Kasturi Narra
              Rama Kasturi Narra Rama Kasturi Narra
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: