Bug 2090092 - Will hit error if specify the channel not the latest
Summary: Will hit error if specify the channel not the latest
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 4.11
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 4.11.0
Assignee: Alex
QA Contact: zhou ying
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-05-25 06:43 UTC by zhou ying
Modified: 2022-08-10 11:14 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-08-10 11:14:09 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift oc-mirror pull 478 0 None open Bug 2090092: fix(list): adds default channel information to operator list to remov… 2022-05-26 14:12:12 UTC
Red Hat Product Errata RHSA-2022:5069 0 None None None 2022-08-10 11:14:28 UTC

Description zhou ying 2022-05-25 06:43:51 UTC
Description of problem:
Will hit error if specify the channel not the latest

Version-Release number of selected component (if applicable):
oc-mirror version 
Client Version: version.Info{Major:"", Minor:"", GitVersion:"4.11.0-202205192208.p0.gf93ddac.assembly.stream-f93ddac", GitCommit:"f93ddac651dbdd9e3092d79b744df8d3b32c8ea4", GitTreeState:"clean", BuildDate:"2022-05-19T22:34:11Z", GoVersion:"go1.18", Compiler:"gc", Platform:"linux/amd64"}


How reproducible:
always

Steps to Reproduce:
1. List channel for package :
`oc-mirror list operators --catalog=registry.redhat.io/redhat/redhat-operator-index:v4.10  --package=quay-operator`
PACKAGE        CHANNEL     HEAD
quay-operator  quay-v3.4   quay-operator.v3.4.7
quay-operator  quay-v3.5   quay-operator.v3.5.7
quay-operator  stable-3.6  quay-operator.v3.6.6
quay-operator  stable-3.7  quay-operator.v3.7.0

2. Specify channel except the latest as following :
cat seting.yaml 
apiVersion: mirror.openshift.io/v1alpha2
kind: ImageSetConfiguration
storageConfig:
  local:
    path: /home/ocmirrortest/newverify
mirror:
  operators:
    - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.10
      packages:
        - name: quay-operator
          channels:
          - name: quay-v3.4
3. Run the mrror command :
`oc-mirror --config seting.yaml file:// --dry-run`


Actual results:
3. The mirror command will failed with error:
oc-mirror --config seting.yaml file:// --dry-run 
Found: oc-mirror-workspace/src/publish
Found: oc-mirror-workspace/src/v2
Found: oc-mirror-workspace/src/charts
No metadata detected, creating new workspace
WARN[0040] 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. 
error: error converting declarative config to include config: invalid index:
└── invalid package "quay-operator":
    └── invalid channel "stable-3.7":
        └── channel must contain at least one bundle


Expected results:
No error , and mirror  the specified package . 


Additional info:
when specify with latest channel stable-3.7 without this error.

Comment 1 Jennifer Power 2022-05-25 14:55:46 UTC
Just to add a bit of background here. In the short term, this issue would have to be handled by documentation. 
We do, however, have a PR to add slightly more context to this error. This issue being seen is that the default channel of the quay operator is being filtered from the index resulting in an invalid index. So an error is expected here. We have an open request to handle the default channel a bit differently but that would be more of a feature https://github.com/openshift/oc-mirror/issues/453. I think something that might also help is having default channel information as an output in the `oc-mirror list operator` command.

Comment 3 Jennifer Power 2022-06-07 19:22:43 UTC
@yinzhou the linked PR would not satisfy your acceptance criteria because the configuration passed to oc-mirror is not valid per OLM constraints. Changes that were made were to allow a user to view the default channel for the package by running "oc-mirror list operators --catalog CATALOG --package PACKAGE". Not sure if that would qualify to move this into the verified, but the request to handle the default channel is being tracked in the "operator-registry" upstream repository as an enhancement at https://github.com/operator-framework/operator-registry/pull/969.

Comment 4 zhou ying 2022-06-10 03:23:45 UTC
oc-mirror list operators  --catalog=registry.redhat.io/redhat/redhat-operator-index:v4.11 --package=rhsso-operator
NAME            DISPLAY NAME                     DEFAULT CHANNEL
rhsso-operator  Red Hat Single Sign-On Operator  stable

PACKAGE         CHANNEL  HEAD
rhsso-operator  alpha    rhsso-operator.7.5.1-opr-005
rhsso-operator  stable   rhsso-operator.7.5.2-opr-002




oc-mirror version 
Client Version: version.Info{Major:"", Minor:"", GitVersion:"4.11.0-202206090038.p0.g49a4f17.assembly.stream-49a4f17", GitCommit:"49a4f1789993d90dc9763cb527a57fd70f9ae0e9", GitTreeState:"clean", BuildDate:"2022-06-09T01:20:22Z", GoVersion:"go1.18", Compiler:"gc", Platform:"linux/amd64"}

Comment 6 errata-xmlrpc 2022-08-10 11:14:09 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


Note You need to log in before you can comment on or make changes to this bug.