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

[v2] oc-mirror doesn't return an error when the specified OpenShift release version is unavailable

XMLWordPrintable

    • None
    • CLID Sprint 271, CLID Sprint 272
    • 2
    • False
    • Hide

      None

      Show
      None
    • Addresses the issue when no release images are found (exit with an error)
    • Bug Fix
    • In Progress

      Description of problem:

          The oc-mirror command does not return an error when a non-existent OpenShift version is specified in the ImageSetConfiguration. This behavior is misleading as users may assume the mirroring process completed successfully, while the required version is not available.

      Version-Release number of selected component (if applicable):

      ./oc-mirror version
      WARNING: This version information is deprecated and will be replaced with the output from --short. Use --output=yaml|json to get the full version.
      Client Version: version.Info{Major:"", Minor:"", GitVersion:"4.17.0-202501230004.p0.g39bedc7.assembly.stream.el9-39bedc7", GitCommit:"39bedc78d79bd13ea7271e5d4c72a12890b05631", GitTreeState:"clean", BuildDate:"2025-01-23T01:27:50Z", GoVersion:"go1.22.9 (Red Hat 1.22.9-2.el9_5) X:strictfipsruntime", Compiler:"gc", Platform:"linux/amd64"}
      

      How reproducible:

          always

      Steps to Reproduce:

          1. Use the following ISC file. There is no 4.17.17 version available in the stable-4.17 channel
      
      kind: ImageSetConfiguration
      apiVersion: mirror.openshift.io/v2alpha1
      mirror:
        platform:
          channels:
          - name: stable-4.17
            minVersion: 4.17.17 
            maxVersion: 4.17.17
      
          2. Run oc-mirror --v=2
          3. Observe that no error is displayed, even though OpenShift 4.17.17 is not available.
           

      Actual results:

      ./oc-mirror -c imageset-config.yaml --workspace file://4.17.17 docker://dchong-test.com:8443/4.17.17 --v2 --dest-tls-verify=false
      2025/02/23 21:24:34  [WARN]   : ⚠️  --v2 flag identified, flow redirected to the oc-mirror v2 version. This is Tech Preview, it is still under development and it is not production ready.
      2025/02/23 21:24:34  [INFO]   : 👋 Hello, welcome to oc-mirror
      2025/02/23 21:24:34  [INFO]   : ⚙️  setting up the environment for you...
      2025/02/23 21:24:34  [INFO]   : 🔀 workflow mode: mirrorToMirror
      2025/02/23 21:24:34  [INFO]   : 🕵️  going to discover the necessary images...
      2025/02/23 21:24:34  [INFO]   : 🔍 collecting release images...
      2025/02/23 21:24:35  [INFO]   : 🔍 collecting operator images...
      2025/02/23 21:24:35  [INFO]   : 🔍 collecting additional images...
      2025/02/23 21:24:35  [INFO]   : 🚀 Start copying the images...
      2025/02/23 21:24:35  [INFO]   : images to copy 1
       ✓   1/1 : (3s) registry.redhat.io/ubi8/ubi:latest
      2025/02/23 21:24:38  [INFO]   : === Results ===
      2025/02/23 21:24:38  [INFO]   : ✅ 1 / 1 additional images mirrored successfully
      2025/02/23 21:24:38  [INFO]   : 📄 No images by digests were mirrored. Skipping IDMS generation.
      2025/02/23 21:24:38  [INFO]   : 📄 Generating ITMS file...
      2025/02/23 21:24:38  [INFO]   : 4.17.17/working-dir/cluster-resources/itms-oc-mirror.yaml file created
      2025/02/23 21:24:38  [INFO]   : 📄 No catalogs mirrored. Skipping CatalogSource file generation.
      2025/02/23 21:24:38  [INFO]   : mirror time     : 3.946198178s
      2025/02/23 21:24:38  [INFO]   : 👋 Goodbye, thank you for using oc-mirror
      

      Expected results:

      oc-mirror should return an appropriate error message when the specified version is not available, preventing users from proceeding under the false assumption that the process succeeded.

      Additional info:

          

              luzuccar@redhat.com Luigi Mario Zuccarelli
              rhn-support-dchong Daniel Chong
              Ying Zhou Ying Zhou
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated: