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

[v2] oc-mirror is mirroring all versions of the ansible-automation-platform-operator, regardless of the value specified in minVersion

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not a Bug
    • Icon: Normal Normal
    • None
    • 4.19
    • oc-mirror
    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • None
    • Moderate
    • None
    • None
    • None
    • None
    • CLID Sprint 278
    • 1
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Description of problem:

      oc-mirror is mirroring all versions of the ansible-automation-platform-operator, regardless of the value specified in minVersion

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

      4.19.9

      How reproducible:

       100 % 

      Steps to Reproduce:

      1- Try mirroring the ansible-automation-platform-operator by setting minVersion to the latest version available in the channel. You’ll notice that it mirrors around 470 images, even though that single version should only require a little over 20 images. This clearly indicates that it’s mirroring all available versions.

       

      [root@vm-236-196 ~]# cat /var/new/workspace-resource-troubleshoot-ansible/working-dir/dry-run/mapping.txt | wc
          467     467  148831
      [root@vm-236-196 ~]# cat ansible-imageset.yaml
      apiVersion: mirror.openshift.io/v2alpha1
      kind: ImageSetConfiguration
      archiveSize: 4
      mirror:
        operators:
          - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.18
            packages:
            - name: ansible-automation-platform-operator
              channels:
              - name: stable-2.5
                minVersion: '2.5.0+0.1755835086'
      
      [root@vm-236-196 ~]# ./oc-mirror-4.19.9/oc-mirror -c  ansible-imageset.yaml --workspace file:///var/new/workspace-resource-troubleshoot-ansible/ docker://zeba.disconnected.ocp419.com:8443/ansible --v2 --authfile=/root/final-pull-secret  --dry-run
      2025/09/02 08:14:40  [INFO]   : 👋 Hello, welcome to oc-mirror
      2025/09/02 08:14:40  [INFO]   : ⚙️  setting up the environment for you...
      2025/09/02 08:14:40  [INFO]   : 🔀 workflow mode: mirrorToMirror 
      2025/09/02 08:14:40  [INFO]   : 🕵  going to discover the necessary images...
      2025/09/02 08:14:40  [INFO]   : 🔍 collecting release images...
      2025/09/02 08:14:40  [INFO]   : 🔍 collecting operator images...
       ✓   (6s) Collecting catalog registry.redhat.io/redhat/redhat-operator-index:v4.18 
      2025/09/02 08:14:47  [INFO]   : 🔍 collecting additional images...
      2025/09/02 08:14:47  [INFO]   : 🔍 collecting helm images...
      2025/09/02 08:14:47  [INFO]   : 📄 list of all images for mirroring in : /var/new/workspace-resource-troubleshoot-ansible/working-dir/dry-run/mapping.txt
      2025/09/02 08:14:47  [INFO]   : mirror time     : 6.449579645s
      2025/09/02 08:14:47  [INFO]   : 👋 Goodbye, thank you for using oc-mirror
      
      [root@vm-236-196 ~]# cat /var/new/workspace-resource-troubleshoot-ansible/working-dir/dry-run/mapping.txt | wc
          467     467  148831 

       

      2- When no minVersion is specified and only the channel is provided, it mirrors around 23 images for the same version 2.5.0+0.1755835086, since that version is the channel head.

       

      [root@vm-236-196 ~]# cat  ansible-imageset.yaml apiVersion: mirror.openshift.io/v2alpha1 kind: ImageSetConfiguration archiveSize: 4 mirror:   operators:     - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.18       packages:       - name: ansible-automation-platform-operator         channels:         - name: stable-2.5
      
      [root@vm-236-196 ~]# ./oc-mirror-4.19.9/oc-mirror -c  ansible-imageset.yaml --workspace file:///var/new/workspace-resource-troubleshoot-ansible/ docker://zeba.disconnected.ocp419.com:8443/ansible --v2 --authfile=/root/final-pull-secret  --dry-run 2025/09/02 08:16:00 [INFO]   : 👋 Hello, welcome to oc-mirror 2025/09/02 08:16:00 [INFO]   : ⚙️  setting up the environment for you... 2025/09/02 08:16:00 [INFO]   : 🔀 workflow mode: mirrorToMirror 2025/09/02 08:16:00 [INFO]   : 🕵  going to discover the necessary images... 2025/09/02 08:16:00 [INFO]   : 🔍 collecting release images... 2025/09/02 08:16:00 [INFO]   : 🔍 collecting operator images... ✓   (6s) Collecting catalog registry.redhat.io/redhat/redhat-operator-index:v4.18 2025/09/02 08:16:07 [INFO]   : 🔍 collecting additional images... 2025/09/02 08:16:07 [INFO]   : 🔍 collecting helm images... 2025/09/02 08:16:07 [INFO]   : 📄 list of all images for mirroring in : /var/new/workspace-resource-troubleshoot-ansible/working-dir/dry-run/mapping.txt 2025/09/02 08:16:07 [INFO]   : mirror time     : 6.744723877s 2025/09/02 08:16:07 [INFO]   : 👋 Goodbye, thank you for using oc-mirror
      
      [root@vm-236-196 ~]# cat  /var/new/workspace-resource-troubleshoot-ansible/working-dir/dry-run/mapping.txt | wc      25      25    7583     

       

      3- It seems this issue only affects the ansible-automation-platform-operator, because when I try the same with another operator, it respects the minVersion setting. For example, see the case with the openshift-gitops-operator below.

      [root@vm-236-196 ~]# cat gitops-imageset-second.yaml
      apiVersion: mirror.openshift.io/v2alpha1
      kind: ImageSetConfiguration
      mirror:
        operators:
          - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.18
            packages:
            - name: openshift-gitops-operator
              defaultChannel: 'gitops-1.13'
              channels:
              - name: 'gitops-1.13'
                minVersion: 1.13.3+0.1741683398.p
      
      [root@vm-236-196 ~]# ./oc-mirror-4.19.9/oc-mirror -c  gitops-imageset-second.yaml --workspace file:///var/new/workspace-resource-troubleshoot-ansible/ docker://zeba.disconnected.ocp419.com:8443/ansible --v2 --authfile=/root/final-pull-secret  --dry-run
      2025/09/02 08:17:56  [INFO]   : 👋 Hello, welcome to oc-mirror
      2025/09/02 08:17:56  [INFO]   : ⚙️  setting up the environment for you...
      2025/09/02 08:17:56  [INFO]   : 🔀 workflow mode: mirrorToMirror 
      2025/09/02 08:17:56  [INFO]   : 🕵  going to discover the necessary images...
      2025/09/02 08:17:56  [INFO]   : 🔍 collecting release images...
      2025/09/02 08:17:56  [INFO]   : 🔍 collecting operator images...
       ✓   (6s) Collecting catalog registry.redhat.io/redhat/redhat-operator-index:v4.18 
      2025/09/02 08:18:03  [INFO]   : 🔍 collecting additional images...
      2025/09/02 08:18:03  [INFO]   : 🔍 collecting helm images...
      2025/09/02 08:18:03  [INFO]   : 📄 list of all images for mirroring in : /var/new/workspace-resource-troubleshoot-ansible/working-dir/dry-run/mapping.txt
      2025/09/02 08:18:03  [INFO]   : mirror time     : 6.920871987s
      2025/09/02 08:18:03  [INFO]   : 👋 Goodbye, thank you for using oc-mirror
      
      
      [root@vm-236-196 ~]# cat /var/new/workspace-resource-troubleshoot-ansible/working-dir/dry-run/mapping.txt | wc
           23      23    6455 

       

      Actual results:

      minVersion not respecting for ansible-automation-platform-operator, instead its mirroring all the versions

      Expected results:

      minVersion should respect for ansible-automation-platform-operator

      Additional info:

      tried with latest 4.19.9 oc-mirror binary

              rh-ee-aguidi Alex Guidi
              rhn-support-amuhamme MUHAMMED ASLAM V K
              None
              None
              Nidan Gavali Nidan Gavali
              None
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: