Bug 2075051

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.10   
Target Milestone: ---   
Target Release: 4.10.z   
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-05-23 13:25:10 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: 2075050    
Bug Blocks:    

Description Jennifer Power 2022-04-13 13:56:27 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.10
    - name: fast-4.10


2. /bin/oc-mirror imageset-config.yaml.49 file://out --log-level=debug
3. /bin/oc-mirror imageset-config.yaml.49 file://out --log-level=debug (Run a second time in a row with the same configuration)

Actual results:

The calculation fails that NoVersions are found in channel stable-4.11.


Expected results:

The upgrade shows updates from the cross-channel calculation and does not error


Additional info:

Comment 4 Jennifer Power 2022-05-10 17:26:46 UTC
@yinzhou Here is are the steps I followed to reproduce:

1. Grab oc-mirror with no fix -> https://mirror.openshift.com/pub/openshift-v4/amd64/clients/ocp/4.10.9/oc-mirror.tar.gz
2. Create an oc-mirror config:

apiVersion: mirror.openshift.io/v1alpha1
kind: ImageSetConfiguration
storageConfig:
  local:
    path: metadata
mirror:
  ocp:
    channels:
    - name: fast-4.10
    - name: stable-4.10

3. Run oc-mirror the first time -> ./bin/oc-mirror --config ~/configs/imageset-config.yaml file://out
4. Run oc-mirror again - ./bin/oc-mirror --config ~/configs/imageset-config.yaml file://out --dry-run
Result:
INFO Found: out/oc-mirror-workspace/src/publish   
INFO Found: out/oc-mirror-workspace/src/v2        
INFO Found: out/oc-mirror-workspace/src/charts    
INFO Downloading requested release 4.10.12        
error: failed to get upgrade graph: NoVersionsFound: no cluster versions found in the "fast-4.11" channel

Please let me know if you need any more info.

Comment 5 zhou ying 2022-05-11 05:17:43 UTC
@jpower , thanks , I could reproduce with older version . let me try with new code . 


 ./oc-mirror --config configset.yaml file://out
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 
INFO Downloading requested release 4.10.12        
error: failed to get upgrade graph: NoVersionsFound: no cluster versions found in the "fast-4.11" channel
[root@localhost ocmirrortest]# ./oc-mirror version 
Client Version: version.Info{Major:"0", Minor:"1", GitVersion:"v0.1.0", GitCommit:"46dd96b5df44f908e3b5b72fe94bfb108ad73870", GitTreeState:"clean", BuildDate:"2022-04-02T04:55:39Z", GoVersion:"go1.17.5", Compiler:"gc", Platform:"linux/amd64"}



can't reproduce with latest oc-mirror now :

./oc-mirror version 
Client Version: version.Info{Major:"0", Minor:"1", GitVersion:"v0.1.0", GitCommit:"adf23635f337f7ec2080b68515b2b829f8b80153", GitTreeState:"clean", BuildDate:"2022-05-05T19:55:47Z", GoVersion:"go1.17.5", Compiler:"gc", Platform:"linux/amd64"}
[root@localhost ocmirrortest]# ./oc-mirror --config configset.yaml file://out
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 
INFO Downloading requested release 4.10.12        
INFO Downloading requested release 4.10.12        
info: Mirroring 162 images to file://openshift/release ...
<dir>
  openshift/release
    blobs:
      quay.io/openshift-release-dev/ocp-v4.0-art-dev sha256:39382676eb30fabb7a0616b064e142f6ef58d45216a9124e9358d14b12dedd65 1.428KiB
      quay.io/openshift-release-dev/ocp-v4.0-art-dev sha256:be1546e7587cc52453fcf178f817fce8141bda5c7b61513e2e387b8de518ccf7 1.805KiB
      quay.io/openshift-release-dev/ocp-v4.0-art-dev sha256:3d24a39db558b3ef9bb9843f44287f330ca9243b586b2c203fcd88571808ccb0 1.832KiB
.....

Comment 8 errata-xmlrpc 2022-05-23 13:25:10 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 (OpenShift Container Platform 4.10.15 bug fix 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/RHBA-2022:2258