Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 2088634

Summary: oc-mirror does not fail when catalog is invalid
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: jpower, vdinh
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:13:14 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:

Description Jennifer Power 2022-05-19 21:54:30 UTC
Description of problem:

oc-mirror does not fail in all cases when the produced catalog is invalid


Version-Release number of selected component (if applicable):
Client Version: version.Info{Major:"", Minor:"", GitVersion:"v0.2.0-alpha.1-41-gf93ddac", GitCommit:"f93ddac6", GitTreeState:"clean", BuildDate:"2022-05-19T21:31:05Z", GoVersion:"go1.17.1", Compiler:"gc", Platform:"linux/amd64"}


How reproducible:
100%


Steps to Reproduce:
1.Generate initial config
apiVersion: mirror.openshift.io/v1alpha2
kind: ImageSetConfiguration
storageConfig:
  local:
    path: test
mirror:
  operators:
    - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.10
      packages:
        - name: quay-operator
2. oc-mirror --config imageset-config.yaml file://out
3. Generate a differential imageset config
apiVersion: mirror.openshift.io/v1alpha2
kind: ImageSetConfiguration
storageConfig:
  local:
    path: test
mirror:
  operators:
    - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.10
      packages:
        - name: quay-operator
          channels:
          - name: quay-v3.5
4. oc-mirror --config imageset-config.yaml file://out

Actual results:

No error when running oc mirror, but when running opm validate on the catalog on the second imageset, this error is found.
FATA[0000] invalid index:
└── invalid package "quay-operator":
    └── invalid channel "stable-3.6":
        └── channel must contain at least one bundle

Expected results:

oc-mirror to produce this error before mirroring


Additional info:

Comment 3 zhou ying 2022-06-06 07:09:47 UTC
With the latest version , I hit error , is this expected ?

oc-mirror --config filter-log.yaml file:// 
Creating directory: oc-mirror-workspace/src/publish
Creating directory: oc-mirror-workspace/src/v2
Creating directory: oc-mirror-workspace/src/charts
WARN[0034] 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. 

The rendered catalog is invalid.

Run "oc-mirror list operators --catalog CATALOG-NAME --package PACKAGE-NAME" for more information.

Please check the minVersion, maxVersion, and default channel for each invalid package.
error: error updating include config: invalid index:
└── invalid package "quay-operator":
    └── invalid channel "stable-3.7":
        └── channel must contain at least one bundle
[root@localhost filterlogging]# oc-mirror list operators --catalog registry.redhat.io/redhat/redhat-operator-index:v4.10 --package quay-operator 
WARN[0028] 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. 
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

I think we hit error : https://bugzilla.redhat.com/show_bug.cgi?id=2090092

Comment 4 zhou ying 2022-06-06 08:52:51 UTC
see comment https://bugzilla.redhat.com/show_bug.cgi?id=2090092#c1, will move to verified status.

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