Bug 1995300 - opm validate does not detect cycles in channels
Summary: opm validate does not detect cycles in channels
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: OLM
Version: 4.9
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.9.0
Assignee: Joe Lanford
QA Contact: xzha
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-08-18 18:49 UTC by Joe Lanford
Modified: 2021-10-18 17:47 UTC (History)
0 users

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-10-18 17:47:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift operator-framework-olm pull 175 0 None None None 2021-08-24 13:49:18 UTC
Red Hat Product Errata RHSA-2021:3759 0 None None None 2021-10-18 17:47:38 UTC

Comment 2 xzha 2021-08-25 10:58:58 UTC
verify

[root@preserve-olm-agent-test test]# opm version
Version: version.Version{OpmVersion:"0178564d0", GitCommit:"0178564d0b6aa035e4daedcb0da94be75c20b90a", BuildDate:"2021-08-25T09:59:28Z", GoOs:"linux", GoArch:"amd64"}


[root@preserve-olm-agent-test test]# cat test/a.yaml 
---
schema: olm.package
name: semver-operator
defaultChannel: alpha
---
image: quay.io/joelanford/semver-operator-bundle:v0.1.0
name: semver-operator.v0.1.0
package: semver-operator
properties:
- type: olm.channel
  value:
    name: alpha
    replaces: semver-operator.v0.2.0
- type: olm.gvk
  value:
    group: example.my.domain
    kind: Operator
    version: v1alpha1
- type: olm.package
  value:
    packageName: semver-operator
    version: 0.1.0
schema: olm.bundle
---
image: quay.io/joelanford/semver-operator-bundle:v0.2.0
name: semver-operator.v0.2.0
package: semver-operator
properties:
- type: olm.channel
  value:
    name: alpha
    replaces: semver-operator.v0.1.0
- type: olm.gvk
  value:
    group: example.my.domain
    kind: Operator
    version: v1alpha1
- type: olm.package
  value:
    packageName: semver-operator
    version: 0.2.0
schema: olm.bundle
---
image: quay.io/joelanford/semver-operator-bundle:v0.3.0
name: semver-operator.v0.3.0
package: semver-operator
properties:
- type: olm.channel
  value:
    name: alpha
    replaces: semver-operator.v0.2.0
- type: olm.gvk
  value:
    group: example.my.domain
    kind: Operator
    version: v1alpha1
- type: olm.package
  value:
    packageName: semver-operator
    version: 0.3.0
schema: olm.bundle

[root@preserve-olm-agent-test test]# opm validate test
FATA[0000] invalid index:
└── invalid package "semver-operator":
    └── invalid channel "alpha":
        └── detected cycle in replaces chain of upgrade graph: semver-operator.v0.2.0 -> semver-operator.v0.1.0 -> semver-operator.v0.2.0 



LGTM, verified.

Comment 5 errata-xmlrpc 2021-10-18 17:47:26 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 (Moderate: OpenShift Container Platform 4.9.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-2021:3759


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