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

[v2] d2m fails when invalid package is found in the ImageSetConfiguration

XMLWordPrintable

    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • CLID Sprint 268
    • 1
    • Done
    • Bug Fix
    • Hide
      * Previously, it was possible to mirror an empty catalog during the mirror-to-disk (m2d) phase if an invalid Operator was specified in the `ImageSetConfiguration` file. This led to a failure during the subsequent disk-to-mirror (d2m) phase. With this release, oc-mirror plugin v2 prevents mirroring empty catalogs by validating operator references in the configuration, ensuring a more reliable mirroring process. (link:https://issues.redhat.com/browse/OCPBUGS-52588[OCPBUGS-52588])
      Show
      * Previously, it was possible to mirror an empty catalog during the mirror-to-disk (m2d) phase if an invalid Operator was specified in the `ImageSetConfiguration` file. This led to a failure during the subsequent disk-to-mirror (d2m) phase. With this release, oc-mirror plugin v2 prevents mirroring empty catalogs by validating operator references in the configuration, ensuring a more reliable mirroring process. (link: https://issues.redhat.com/browse/OCPBUGS-52588 [ OCPBUGS-52588 ])
    • None
    • None
    • None
    • None

      Description of problem:

      When an invalid packages are included in the ImageSetConfiguration and the operator catalog becomes without any valid package, d2m fails. The operator catalog image should be skipped in case no operators were found for that operator catalog.

      With the following ImageSetConfiguration:

      kind: ImageSetConfiguration
      apiVersion: mirror.openshift.io/v2alpha1
      mirror:
        operators:
          - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.17
            packages:
             - name: netscaler-operator 
      1. m2d
         ./bin/oc-mirror -c ./alex-tests/alex-isc/pr-1093.yaml file://alex-tests/pr-1093 --v2 

      2. I removed the working-dir under the folder pr-1093 and the oc-mirror cache to simulate a d2m from scratch on a disconnected environment where I only have the tarball

          rm -rf ~/.oc-mirror/ && rm -rf ./alex-tests/pr-1093/working-dir

      3. d2m

          ./bin/oc-mirror -c ./alex-tests/alex-isc/pr-1093.yaml --from file://alex-tests/pr-1093 docker://localhost:6000 --dest-tls-verify=false --v2

      Actual results:

          ./bin/oc-mirror -c ./alex-tests/alex-isc/pr-1093.yaml --from file://alex-tests/pr-1093 docker://localhost:6000 --dest-tls-verify=false --v2
      
      2025/03/07 12:29:46  [INFO]   : :wave: Hello, welcome to oc-mirror
      2025/03/07 12:29:46  [INFO]   : :gear:  setting up the environment for you...
      2025/03/07 12:29:46  [INFO]   : :twisted_rightwards_arrows: workflow mode: diskToMirror 
      2025/03/07 12:30:11  [INFO]   : 🕵  going to discover the necessary images...
      2025/03/07 12:30:11  [INFO]   : :mag: collecting release images...
      2025/03/07 12:30:11  [INFO]   : :mag: collecting operator images...
      2025/03/07 12:30:11  [ERROR]  : [OperatorImageCollector] stat .: no such file or directory
       ✗   () Collecting catalog registry.redhat.io/redhat/redhat-operator-index:v4.17 
      2025/03/07 12:30:11  [INFO]   : :wave: Goodbye, thank you for using oc-mirror
      2025/03/07 12:30:11  [ERROR]  : stat .: no such file or directory

      Expected results:

      m2d should should fail when there is no related images found for the specified catalog (invalid operator netscaler-operator for the ImageSetConfiguration used above)

      Additional info:

          

              rh-ee-aguidi Alex Guidi
              rh-ee-aguidi Alex Guidi
              None
              None
              Ying Zhou Ying Zhou
              None
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: