Bug 2088634 - oc-mirror does not fail when catalog is invalid
Summary: oc-mirror does not fail when catalog is invalid
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 4.11
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 4.11.0
Assignee: Alex
QA Contact: zhou ying
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-05-19 21:54 UTC by Jennifer Power
Modified: 2022-08-10 11:13 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:13:14 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift oc-mirror pull 464 0 None open Bug 2088634: fix(operator): adds validation after rendering dc to check for invali… 2022-05-24 16:45:59 UTC
Red Hat Product Errata RHSA-2022:5069 0 None None None 2022-08-10 11:13:25 UTC

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


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