Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCPBUGS-21865: Honor IncludeChannel.MaxVersion when mirroring differe… #761

Merged
merged 1 commit into from Dec 15, 2023

Conversation

sherine-k
Copy link
Contributor

…ntially

Description

When a previous mirroring had occurred, and the operator mirroring is bound by both minVersion and maxVersion in the imageSetConfig, oc-mirror was ignoring the MaxVersion, and mirroring all bundles up to the channel head.

Fixes OCPBUGS-21865

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Specific unit tests covering the case described by the bug reporter have been added.
Furthermore, we used the following use case to validate the change:

  1. ./bin/oc-mirror -c isc_21865_1.yaml file:///home/skhoury/test1
  2. cp -r /home/skhoury/test1/metadata /home/skhoury/test1/metadata_save
  3. ./bin/oc-mirror -c isc_21865_2.yaml file:///home/skhoury/test1 --dry-run

isc_21865_1.yaml

kind: ImageSetConfiguration
apiVersion: mirror.openshift.io/v1alpha2
storageConfig:
  local:
    path: /home/skhoury/test1/metadata
mirror:
  
  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

isc_21865_2.yaml

kind: ImageSetConfiguration
apiVersion: mirror.openshift.io/v1alpha2
storageConfig:
  local:
    path: /home/skhoury/test1/metadata
mirror:
  operators:
    - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.12
      skipDependencies: true
      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

Expected Outcome

Inspecting the mapping.txt file generated before and after the change with

grep "\-bundle" /home/skhoury/test1/oc-mirror-workspace/mapping.txt
registry.redhat.io/openshift4/ose-local-storage-operator-bundle@sha256:b0f47e35fbd4e8d0053a28a79d8d59d92458d14f31e9d7a1ffbd71416da7a660=file://openshift4/ose-local-storage-operator-bundle:6d4aacc3
registry.redhat.io/rh-sso-7/sso7-rhel8-operator-bundle@sha256:0678aad21b12b433e29d8a7e6280e7b2ea2c0251a3e27a60d32ba6c877a7051d=file://rh-sso-7/sso7-rhel8-operator-bundle:372777e8
registry.redhat.io/odf4/odf-operator-bundle@sha256:5ccc9c304ce9aa903bafcbfc6013f6608eb1311724a89da4fb9b674d713c4c6c=file://odf4/odf-operator-bundle:7abe234f

You should notice that after the patch there is only 1 bundle image for the 3 operators that are included in the mirroring, while several bundle images exist for the same operator without the patch.

@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. labels Dec 13, 2023
@openshift-ci-robot
Copy link

@sherine-k: This pull request references Jira Issue OCPBUGS-21865, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.16.0) matches configured target version for branch (4.16.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @zhouying7780

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

…ntially

Description

When a previous mirroring had occurred, and the operator mirroring is bound by both minVersion and maxVersion in the imageSetConfig, oc-mirror was ignoring the MaxVersion, and mirroring all bundles up to the channel head.

Fixes OCPBUGS-21865

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Specific unit tests covering the case described by the bug reporter have been added.
Furthermore, we used the following use case to validate the change:

  1. ./bin/oc-mirror -c isc_21865_1.yaml file:///home/skhoury/test1
  2. cp -r /home/skhoury/test1/metadata /home/skhoury/test1/metadata_save
  3. ./bin/oc-mirror -c isc_21865_2.yaml file:///home/skhoury/test1 --dry-run

isc_21865_1.yaml

kind: ImageSetConfiguration
apiVersion: mirror.openshift.io/v1alpha2
storageConfig:
 local:
   path: /home/skhoury/test1/metadata
mirror:
 
 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

isc_21865_2.yaml

kind: ImageSetConfiguration
apiVersion: mirror.openshift.io/v1alpha2
storageConfig:
 local:
   path: /home/skhoury/test1/metadata
mirror:
 operators:
   - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.12
     skipDependencies: true
     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

Expected Outcome

Inspecting the mapping.txt file generated before and after the change with

grep "\-bundle" /home/skhoury/test1/oc-mirror-workspace/mapping.txt
registry.redhat.io/openshift4/ose-local-storage-operator-bundle@sha256:b0f47e35fbd4e8d0053a28a79d8d59d92458d14f31e9d7a1ffbd71416da7a660=file://openshift4/ose-local-storage-operator-bundle:6d4aacc3
registry.redhat.io/rh-sso-7/sso7-rhel8-operator-bundle@sha256:0678aad21b12b433e29d8a7e6280e7b2ea2c0251a3e27a60d32ba6c877a7051d=file://rh-sso-7/sso7-rhel8-operator-bundle:372777e8
registry.redhat.io/odf4/odf-operator-bundle@sha256:5ccc9c304ce9aa903bafcbfc6013f6608eb1311724a89da4fb9b674d713c4c6c=file://odf4/odf-operator-bundle:7abe234f

You should notice that after the patch there is only 1 bundle image for the 3 operators that are included in the mirroring, while several bundle images exist for the same operator without the patch.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link

openshift-ci bot commented Dec 13, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sherine-k

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 13, 2023
@lmzuccarelli
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 15, 2023
Copy link

openshift-ci bot commented Dec 15, 2023

@sherine-k: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot bot merged commit 83acc2a into openshift:main Dec 15, 2023
5 checks passed
@openshift-ci-robot
Copy link

@sherine-k: Jira Issue OCPBUGS-21865: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-21865 has been moved to the MODIFIED state.

In response to this:

…ntially

Description

When a previous mirroring had occurred, and the operator mirroring is bound by both minVersion and maxVersion in the imageSetConfig, oc-mirror was ignoring the MaxVersion, and mirroring all bundles up to the channel head.

Fixes OCPBUGS-21865

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Specific unit tests covering the case described by the bug reporter have been added.
Furthermore, we used the following use case to validate the change:

  1. ./bin/oc-mirror -c isc_21865_1.yaml file:///home/skhoury/test1
  2. cp -r /home/skhoury/test1/metadata /home/skhoury/test1/metadata_save
  3. ./bin/oc-mirror -c isc_21865_2.yaml file:///home/skhoury/test1 --dry-run

isc_21865_1.yaml

kind: ImageSetConfiguration
apiVersion: mirror.openshift.io/v1alpha2
storageConfig:
 local:
   path: /home/skhoury/test1/metadata
mirror:
 
 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

isc_21865_2.yaml

kind: ImageSetConfiguration
apiVersion: mirror.openshift.io/v1alpha2
storageConfig:
 local:
   path: /home/skhoury/test1/metadata
mirror:
 operators:
   - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.12
     skipDependencies: true
     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

Expected Outcome

Inspecting the mapping.txt file generated before and after the change with

grep "\-bundle" /home/skhoury/test1/oc-mirror-workspace/mapping.txt
registry.redhat.io/openshift4/ose-local-storage-operator-bundle@sha256:b0f47e35fbd4e8d0053a28a79d8d59d92458d14f31e9d7a1ffbd71416da7a660=file://openshift4/ose-local-storage-operator-bundle:6d4aacc3
registry.redhat.io/rh-sso-7/sso7-rhel8-operator-bundle@sha256:0678aad21b12b433e29d8a7e6280e7b2ea2c0251a3e27a60d32ba6c877a7051d=file://rh-sso-7/sso7-rhel8-operator-bundle:372777e8
registry.redhat.io/odf4/odf-operator-bundle@sha256:5ccc9c304ce9aa903bafcbfc6013f6608eb1311724a89da4fb9b674d713c4c6c=file://odf4/odf-operator-bundle:7abe234f

You should notice that after the patch there is only 1 bundle image for the 3 operators that are included in the mirroring, while several bundle images exist for the same operator without the patch.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-bot
Copy link
Contributor

[ART PR BUILD NOTIFIER]

This PR has been included in build oc-mirror-plugin-container-v4.16.0-202312150911.p0.g83acc2a.assembly.stream for distgit oc-mirror-plugin.
All builds following this will include this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants