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

oc-mirror shouldn't clean out the operator versions that are not referenced in the channel anymore

    XMLWordPrintable

Details

    • Important
    • CFE Sprint 234
    • 1
    • Rejected
    • False
    • Hide

      None

      Show
      None
    • Hide
      --- AsciiDoc for release notes ---

      [id="ocp-4-12-11-features"]
      ==== Features

      [id="ocp-4-12-11-oc-mirror-skip-pruning"]
      ===== New flag for the oc-mirror plugin: --skip-pruning

      With this update, you can now use the `--skip-pruning` flag for the oc-mirror plugin to disable automatic pruning of images from the target mirror registry.

      --- Original ---

      oc-mirror performs pruning of any operator versions that are not referenced in the channel anymore.
      This results in deleting the corresponding images from the destination registry.
      The fix consists of introducing a --skip-pruning, which enables the user to bypass this pruning feature.
      Show
      --- AsciiDoc for release notes --- [id="ocp-4-12-11-features"] ==== Features [id="ocp-4-12-11-oc-mirror-skip-pruning"] ===== New flag for the oc-mirror plugin: --skip-pruning With this update, you can now use the `--skip-pruning` flag for the oc-mirror plugin to disable automatic pruning of images from the target mirror registry. --- Original --- oc-mirror performs pruning of any operator versions that are not referenced in the channel anymore. This results in deleting the corresponding images from the destination registry. The fix consists of introducing a --skip-pruning, which enables the user to bypass this pruning feature.
    • Feature
    • In Progress

    Description

      Description of problem:

      oc-mirror shouldn't clean out the operator versions that are not referenced in the channel anymore
      
      Cu has following ImageSetConfiguration. They are running oc-mirror GitVersion: 4.11.0-2022082035.p0.g3c1c80c.assembly.stream-3c1c80c.
      
      apiVersion: mirror.openshift.io/v1alpha2
      kind: ImageSetConfiguration
      mirror:
        operators:
          - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.10
            targetName: bit-redhat-operator-catalog-platform-essentials-index
            packages:
              - name: elasticsearch-operator
                channels:
                  - name: stable
                minVersion: 5.4.2
              - name: cluster-logging
                channels:
                  - name: stable
                minVersion: 5.4.2
      
      This works at first and it makes 5.4.2 available in their internal catalog. However after some time the version 5.4.2 disappears out of their catalog and we get the following error while syncing:
      
      ERRO[0108] Operator elasticsearch-operator was not found, please check name, minVersion, maxVersion, and channels in the config file.
      ERRO[0108] Operator cluster-logging was not found, please check name, minVersion, maxVersion, and channels in the config file.
      
      The issue is that the original configured version 5.4.2 is not anymore in the catalog, which we can verify by querying the catalog:
      
      $ oc-mirror list operators --catalog registry.redhat.io/redhat/redhat-operator-index:v4.10 --package elasticsearch-operator --channel stable
      WARN[0022] DEPRECATION NOTICE:
      Sqlite-based catalogs and their related subcommands are deprecated. Support for
      them will be removed in a future release. Please migrate your catalog workflows
      to the new file-based catalog format.
      VERSIONS
      5.5.0
      
      $ oc-mirror list operators --catalog registry.redhat.io/redhat/redhat-operator-index:v4.10 --package elasticsearch-operator --channel stable-5.4
      WARN[0019] DEPRECATION NOTICE:
      Sqlite-based catalogs and their related subcommands are deprecated. Support for
      them will be removed in a future release. Please migrate your catalog workflows
      to the new file-based catalog format.
      VERSIONS
      5.4.4
      
      So,
      a) the version 5.4.2 completely disappeard
      b) the stable channel now starts with 5.5.0
      
      The oc-mirror would clean out the versions that are not referenced anymore and thus we would assume that 5.4.2 would be cleaned from the mirror. Which they definitely do not want to happen, since they still have that version on clusters in their environment.
      
      It is quite tedious to keep editing the image-set.yaml for all the versions that disappear out of the catalog
      
      

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

      oc-mirror GitVersion: 4.11.0-2022082035.p0.g3c1c80c.assembly.stream-3c1c80c
      

      How reproducible:

      100%
      

      Steps to Reproduce:

      1. Create an ImageSetConfiguration to mirror a particular operator
      2. Mirror the operator to mirror registry using oc-mirror
      3. The specified version of the operator disappears from the catalog after a few days when there are changes in the channel and start getting the mentioned error on sync.
      

      Actual results:

      Operator disappears from the catalog
      

      Expected results:

      The mentioned version of the operator to be available in mirror registry even after it's not referenced in the channel
      

      Additional info:

      
      

      Attachments

        Issue Links

          Activity

            People

              luzuccar@redhat.com Luigi Mario Zuccarelli
              rhn-support-alosingh Alok Singh
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: