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

oc-mirror heads-only does not work with target name

XMLWordPrintable

    • Moderate
    • None
    • CFE Sprint 234
    • 1
    • False
    • Hide

      None

      Show
      None
    • Hide
      If no minVersion or maxVersion are set for an operator catalog in the ImageSetConfig, and specifying a targetName, oc-mirror does not record the operator bundles minimum version.
      This behavior will prune bundles of that operator at the following execution of oc-mirror.
      The fix consists of preserving the minVersion of operator catalog in the metadata for those catalogs that have a targetName specified in the ImageSetConfig.

      Show
      If no minVersion or maxVersion are set for an operator catalog in the ImageSetConfig, and specifying a targetName, oc-mirror does not record the operator bundles minimum version. This behavior will prune bundles of that operator at the following execution of oc-mirror. The fix consists of preserving the minVersion of operator catalog in the metadata for those catalogs that have a targetName specified in the ImageSetConfig.
    • Bug Fix
    • In Progress

      Description of problem:

      When used in heads-only mode, oc-mirror does not record the operator bundles minimum version if a target name is set.
      
      The record values ensures that bundles that still exist in the catalog are included as part of the generated catalog and that the associated images are not pruned. This behavior will prune bundles that have when no minimum version is set in the imageset configuration and the bundles still exist in the source catalog.

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

      Client Version: version.Info{Major:"", Minor:"", GitVersion:"4.13.0-202212011938.p0.g8bf1402.assembly.stream-8bf1402", GitCommit:"8bf14023aa018e12425e29993e6f53f0ab07e6ab", GitTreeState:"clean", BuildDate:"2022-12-01T19:56:31Z", GoVersion:"go1.18.4", Compiler:"gc", Platform:"linux/amd64"}
      

      How reproducible:

      100%

      Steps to Reproduce:

      Using the advanced cluster management package as an example.
      
      1. Find the latest bundle for acm in the release-2.6 channel with oc-mirror list operators --catalog registry.redhat.io/redhat/redhat-operator-index:v4.10-1663021232 --package advanced-cluster-management
      2. Create an mirror set configuration to mirror an operator from an older catalog version
      
      apiVersion: mirror.openshift.io/v1alpha2
      kind: ImageSetConfiguration
      storageConfig:
        local:
          path: test
      mirror:
        operators:
          - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.10-1663021232
            targetName: test
            targetTag: test
            packages:
              - name: advanced-cluster-management
                channels:
                  - name: release-2.6
      
      
      2. Run oc-mirror --config config-with-operators.yaml file://
      3. Check the bundle minimum version on the metadata using oc-mirror describe mirror_seq1_000000.tar under the field operators, the advanced-cluster-management should show version found in Step 1.
      4. Create another ImageSetConfiguration for a later version of the catalog
      apiVersion: mirror.openshift.io/v1alpha2
      kind: ImageSetConfiguration
      storageConfig:
        local:
          path: test 
      mirror:
        operators:
          - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.10
            targetName: test
            targetTag: test
            packages:
              - name: advanced-cluster-management
                channels:
                  - name: release-2.6
      4. Check the bundle minimum version on the metadata using oc-mirror describe mirror_seq2_000000.tar under the operators field. 
      
      

      Actual results:

      The catalog entry in the metadata shows packages as null.

      Expected results:

      It should have the advanced-cluster-managament package with the original minimum version or an updated minimum version if the original bundle was pruned.
       

       

        1. Imageset_error
          7 kB
          Santhiya R
        2. Imageset_splited_catalog
          3 kB
          Santhiya R

              luzuccar@redhat.com Luigi Mario Zuccarelli
              jpower_personal Jennifer Power
              Rama Kasturi Narra Rama Kasturi Narra
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

                Created:
                Updated:
                Resolved: