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

oc-mirror doesn't respect the minVersion & maxVersion

XMLWordPrintable

    • No
    • CLID Sprint 246
    • 1
    • Rejected
    • False
    • Hide

      None

      Show
      None
    • Hide
      Previously, when mirroring operators, oc-mirror would ignore the `maxVersion` constraint in `imageSetConfig` if both `minVersion` and `maxVersion` were specified. This resulted in mirroring all bundles up to the channel head. With this update, oc-mirror now considers the `maxVersion` constraint as specified in `imageSetConfig`.
      (link:https://issues.redhat.com/browse/OCPBUGS-21865[*OCPBUGS-21865*])
      Show
      Previously, when mirroring operators, oc-mirror would ignore the `maxVersion` constraint in `imageSetConfig` if both `minVersion` and `maxVersion` were specified. This resulted in mirroring all bundles up to the channel head. With this update, oc-mirror now considers the `maxVersion` constraint as specified in `imageSetConfig`. (link: https://issues.redhat.com/browse/OCPBUGS-21865 [* OCPBUGS-21865 *])
    • Bug Fix
    • Done

      oc-mirror - maxVersion of the imageset config is ignored for operators

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

       

      How reproducible:

       

      Steps to Reproduce:

      1. Create 2 imageset that we are using:
      
      _imageset-config-test1-1.yaml:_
      ~~~
      kind: ImageSetConfiguration
      apiVersion: mirror.openshift.io/v1alpha2
      storageConfig:
        local:
          path: /local/oc-mirror/test1/metadata
      mirror:
        platform:
          architectures:
            - amd64
          graph: true
          channels:
            - name: stable-4.12
              type: ocp
              minVersion: 4.12.1
              maxVersion: 4.12.1
              shortestPath: true
        operators:
          - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.12
            packages:
              - name: cincinnati-operator
                channels:
                  - name: v1
                    minVersion: 5.0.1
                    maxVersion: 5.0.1
      ~~~
      
      _imageset-config-test1-2.yaml:_
      ~~~
      kind: ImageSetConfiguration
      apiVersion: mirror.openshift.io/v1alpha2
      storageConfig:
        local:
          path: /local/oc-mirror/test1/metadata
      mirror:
        platform:
          architectures:
            - amd64
          graph: true
          channels:
            - name: stable-4.12
              type: ocp
              minVersion: 4.12.1
              maxVersion: 4.12.1
              shortestPath: true
        operators:
          - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.12
            packages:
              - name: cincinnati-operator
                channels:
                  - name: v1
                    minVersion: 5.0.1
                    maxVersion: 5.0.1
              - name: local-storage-operator
                channels:
                  - name: stable
                    minVersion: 4.12.0-202305262042
                    maxVersion: 4.12.0-202305262042
              - name: odf-operator
                channels:
                  - name: stable-4.12
                    minVersion: 4.12.4-rhodf
                    maxVersion: 4.12.4-rhodf
              - name: rhsso-operator
                channels:
                  - name: stable
                    minVersion: 7.6.4-opr-002
                    maxVersion: 7.6.4-opr-002
          - catalog: registry.redhat.io/redhat/redhat-marketplace-index:v4.12
            packages:
              - name: k10-kasten-operator-rhmp
                channels:
                  - name: stable
                    minVersion: 6.0.6
                    maxVersion: 6.0.6
        additionalImages:
          - name: registry.redhat.io/rhel8/postgresql-13:1-125
      ~~~
      
      2. Generate a first .tar file from the first imageset-config file (imageset-config-test1-1.yaml)
      oc mirror --config=imageset-config-test1-1.yaml file:///local/oc-mirror/test1
      
      3. Use the first .tar file to populate our registry
      oc mirror --from=/root/oc-mirror/test1/mirror_seq1_000000.tar docker://registry-url/oc-mirror1
      
      4.Generate a second .tar file from the second imageset-config file (imageset-config-test1-2.yaml)
      oc mirror --config=imageset-config-test1-2.yaml file:///local/oc-mirror/test1
      
      5. Populate the private registry named `oc-mirror1` with the second .tar file:
      
      oc mirror --from=/root/oc-mirror/test1/mirror_seq2_000000.tar docker://registry-url/oc-mirror1
      
      6. Check the catalog index for **odf** and **rhsso** operators
      
      [root@test ~]# oc-mirror list operators --package odf-operator --catalog=registry-url/oc-mirror1/redhat/redhat-operator-index:v4.12 --channel stable-4.12
          VERSIONS
          4.12.7-rhodf
          4.12.8-rhodf
          4.12.4-rhodf
          4.12.5-rhodf
          4.12.6-rhodf
      
      [root@test ~]# oc-mirror list operators --package rhsso-operator --catalog=registry-url/oc-mirror1/redhat/redhat-operator-index:v4.12 --channel stable
          VERSIONS
          7.6.4-opr-002
          7.6.4-opr-003
          7.6.5-opr-001
          7.6.5-opr-002

      Actual results:

      Check the catalog index for **odf** and **rhsso** operators. oc-mirror is not respecting the minVersion & maxVersion
      
      [root@test ~]# oc-mirror list operators --package odf-operator --catalog=registry-url/oc-mirror1/redhat/redhat-operator-index:v4.12 --channel stable-4.12 VERSIONS 4.12.7-rhodf 4.12.8-rhodf 4.12.4-rhodf 4.12.5-rhodf 4.12.6-rhodf
      
      [root@test ~]# oc-mirror list operators --package rhsso-operator --catalog=registry-url/oc-mirror1/redhat/redhat-operator-index:v4.12 --channel stable VERSIONS 7.6.4-opr-002 7.6.4-opr-003 7.6.5-opr-001 7.6.5-opr-002

      Expected results:

      oc-mirror should respect the minVersion & maxVersion
      
      [root@test ~]# oc-mirror list operators --package odf-operator --catalog=registry-url/oc-mirror2/redhat/redhat-operator-index:v4.12 --channel stable-4.12 VERSIONS 4.12.4-rhodf
      
      [root@test ~]# oc-mirror list operators --package rhsso-operator --catalog=registry-url/oc-mirror2/redhat/redhat-operator-index:v4.12 --channel stable VERSIONS 7.6.4-opr-002

      Additional info:

       

              skhoury@redhat.com Sherine Khoury
              rhn-support-bshaw Bikash Shaw
              ying zhou ying zhou
              Subhashini T K Subhashini T K
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: