Bug 2075050

Summary: oc-mirror fails to calculate between two channels with different prefixes for the same version of OCP
Product: OpenShift Container Platform Reporter: Jennifer Power <jpower>
Component: ocAssignee: Alex <aflom>
oc sub component: oc-mirror QA Contact: zhou ying <yinzhou>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: unspecified CC: aos-bugs, jpower, vdinh, yinzhou
Version: 4.11   
Target Milestone: ---   
Target Release: 4.11.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-08-10 11:07:02 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2075051    

Description Jennifer Power 2022-04-13 13:55:56 UTC
Description of problem:
When mirroring the latest for both the fast and stable changes for the same major and minor release for OCP. The Cincinnati calculation fails that no versions are found in a non-existent channel.


Version-Release number of selected component (if applicable):
Client Version: version.Info{Major:"0", Minor:"2", GitVersion:"v0.2.0-alpha.1", GitCommit:"772bfc23b0e6d266c96de3edba3f707c64582b46", GitTreeState:"clean", BuildDate:"2022-04-13T13:33:00Z", GoVersion:"go1.18", Compiler:"gc", Platform:"linux/amd64"}

How reproducible:
100%

Steps to Reproduce:
1. Create an imageset config like the following
apiVersion: mirror.openshift.io/v1alpha2
kind: ImageSetConfiguration
storageConfig:
  local:
    path: metadata
mirror:
  platform:
    channels:
    - name: stable-4.8
    - name: fast-4.10


2. /bin/oc-mirror imageset-config.yaml.49 file://out --log-level=debug
Actual results:

There following warning appears:

WARNING No upgrade path for 4.9.28 in target channel fast-4.10 


Expected results:

The upgrade shows updates from the cross-channel calculation and does not show a warning.


Additional info:

Comment 3 Jennifer Power 2022-04-26 12:12:37 UTC
@yinzhou Here is more information about how to reproduce this in the 4.11 release. The latest nightly release should have the fix so the warning will not appear there. Below are the steps I took:

This configuration was used for each step

1. Create an imageset config like the following
apiVersion: mirror.openshift.io/v1alpha2
kind: ImageSetConfiguration
storageConfig:
  local:
    path: metadata
mirror:
  platform:
    channels:
    - name: stable-4.8
    - name: fast-4.10


2. Downloaded an older 4.11 release of oc-mirror to verify the problem (https://mirror.openshift.com/pub/openshift-v4/amd64/clients/ocp-dev-preview/4.11.0-0.nightly-2022-04-16-163450/oc-mirror.tar.gz)
3. Run /bin/oc-mirror imageset-config.yaml.49 file://out --log-level=debug
The output here will be something like the below, which is an example of the problem because there is an upgrade path for 4.9.28 in fast-4.10
INFO Found: out/oc-mirror-workspace/src/publish   
INFO Found: out/oc-mirror-workspace/src/v2        
INFO Found: out/oc-mirror-workspace/src/charts    
DEBUG Using local backend at location metadatafake 
DEBUG looking for metadata file at "publish/.metadata.json" 
INFO No metadata detected, creating new workspace 
DEBUG Detected minimum version as 4.8.36           
DEBUG Detected minimum version as 4.8.36           
DEBUG Found update 4.8.36                          
DEBUG Detected minimum version as 4.10.11          
DEBUG Detected minimum version as 4.10.11          
DEBUG Found update 4.10.11                         
DEBUG Getting updates for version 4.8.36 in channel stable-4.9 
WARNING No upgrade path for 4.9.28 in target channel fast-4.10 
DEBUG Found update 4.8.36                          
DEBUG Found update 4.9.28  

Repeat these steps with a later 4.11 release of oc-mirror (https://mirror.openshift.com/pub/openshift-v4/amd64/clients/ocp-dev-preview/4.11.0-0.nightly-2022-04-25-171513/oc-mirror.tar.gz)
Output is as expected:

INFO Found: out/oc-mirror-workspace/src/publish   
INFO Found: out/oc-mirror-workspace/src/v2        
INFO Found: out/oc-mirror-workspace/src/charts    
DEBUG Using local backend at location metadatafake 
DEBUG looking for metadata file at "publish/.metadata.json" 
INFO No metadata detected, creating new workspace 
DEBUG Detected minimum version as 4.8.36           
DEBUG Detected minimum version as 4.8.36           
DEBUG Found update 4.8.36                          
DEBUG Detected minimum version as 4.10.11          
DEBUG Detected minimum version as 4.10.11          
DEBUG Found update 4.10.11                         
DEBUG Getting updates for version 4.8.36 in channel stable-4.9 
DEBUG Getting updates for version 4.9.28 in channel fast-4.10 
DEBUG Found update 4.8.36                          
DEBUG Found update 4.9.28                          
DEBUG Found update 4.10.11 

Note: The --dry-run flag could be used in this command to replicate the issue and save time.

Comment 4 zhou ying 2022-04-27 08:11:30 UTC
Jennifer Power thanks very much, 

could reproduce with older version :
 oc-mirror version 
Client Version: version.Info{Major:"0", Minor:"2", GitVersion:"v0.2.0-alpha.1", GitCommit:"fe632617c6d574a0813dc237fbf8218d80112ed4", GitTreeState:"clean", BuildDate:"2022-04-09T07:03:31Z", GoVersion:"go1.17.5", Compiler:"gc", Platform:"linux/amd64"}

oc-mirror --config configset.yaml file://out --log-level=debug
INFO Creating directory: out/oc-mirror-workspace/src/publish 
INFO Creating directory: out/oc-mirror-workspace/src/v2 
INFO Creating directory: out/oc-mirror-workspace/src/charts 
DEBUG Using local backend at location /home/ocmirrortest/out 
DEBUG looking for metadata file at "publish/.metadata.json" 
INFO No metadata detected, creating new workspace 
DEBUG Detected minimum version as 4.8.36           
DEBUG Detected minimum version as 4.8.36           
DEBUG Found update 4.8.36                          
DEBUG Detected minimum version as 4.10.11          
DEBUG Detected minimum version as 4.10.11          
DEBUG Found update 4.10.11                         
DEBUG Getting updates for version 4.8.36 in channel stable-4.9 
WARNING No upgrade path for 4.9.28 in target channel fast-4.10 
DEBUG Found update 4.8.36                          
DEBUG Found update 4.9.28                          



and can't reproduce with latest code:
./oc-mirror version 
Client Version: version.Info{Major:"", Minor:"", GitVersion:"4.11.0-202204230048.p0.gd884112.assembly.stream-d884112", GitCommit:"d884112f2e8eb12beb726888fe791ab58fbc80ab", GitTreeState:"clean", BuildDate:"2022-04-23T01:17:22Z", GoVersion:"go1.17.5", Compiler:"gc", Platform:"linux/amd64"}
./oc-mirror --config configset.yaml file://out --log-level=debug
INFO Found: out/oc-mirror-workspace/src/publish   
INFO Found: out/oc-mirror-workspace/src/v2        
INFO Found: out/oc-mirror-workspace/src/charts    
DEBUG Using local backend at location /home/ocmirrortest/out 
DEBUG looking for metadata file at "publish/.metadata.json" 
INFO No metadata detected, creating new workspace 
DEBUG Detected minimum version as 4.8.36           
DEBUG Detected minimum version as 4.8.36           
DEBUG Found update 4.8.36                          
DEBUG Detected minimum version as 4.10.11          
DEBUG Detected minimum version as 4.10.11          
DEBUG Found update 4.10.11                         
DEBUG Getting updates for version 4.8.36 in channel stable-4.9 
DEBUG Getting updates for version 4.9.28 in channel fast-4.10 
DEBUG Found update 4.8.36                          
DEBUG Found update 4.9.28                          
DEBUG Found update 4.10.11                         
DEBUG download quay.io/openshift-release-dev/ocp-release@sha256:0dc1a4b4d9ea7954987f63e506474a4f0dc55e5f1ea5c1f6f1179e2c09eaffda exists 
DEBUG download quay.io/openshift-release-dev/ocp-release@sha256:faf1f5ae9636ef79c6027cd1ca68b0a93607f8ccc12e8e537f8f8bc21d7dfb15 exists 
DEBUG Starting release download for version quay.io/openshift-release-dev/ocp-release@sha256:faf1f5ae9636ef79c6027cd1ca68b0a93607f8ccc12e8e537f8f8bc21d7dfb15 
DEBUG Using /usr/bin/unpigz to decompress          
DEBUG Using /usr/bin/unpigz to decompress

Comment 6 errata-xmlrpc 2022-08-10 11:07:02 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: OpenShift Container Platform 4.11.0 bug fix and security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:5069