Bug 1859717 - Cannot remove a version from CRD during operator upgrade
Summary: Cannot remove a version from CRD during operator upgrade
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: OLM
Version: 4.5
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.6.0
Assignee: Evan Cordell
QA Contact: kuiwang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-07-22 18:54 UTC by Tim Kaczynski
Modified: 2021-01-25 11:20 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-10-27 16:16:41 UTC
Target Upstream Version:
Embargoed:
kuiwang: needinfo-
kuiwang: needinfo-
kaczynsk: needinfo-
kaczynsk: needinfo-


Attachments (Terms of Use)
Failing installplan (45.00 KB, text/plain)
2020-07-22 18:54 UTC, Tim Kaczynski
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:4196 0 None None None 2020-10-27 16:17:00 UTC

Description Tim Kaczynski 2020-07-22 18:54:10 UTC
Created attachment 1702127 [details]
Failing installplan

Description of problem:
We have an OLM enabled operator that includes two channels / two CSVs.  The second CSV replaces the first.  The first contains a CRD with two versions.  One of the versions is not stored and not served, the other version is both stored and served.  We're trying to remove the not stored and not served version in the second CSV.  If we subscribe to the first channel/CSV, then we get this error in the installplan when we attempt to switch the subscription to the second channel/CSV:

  conditions:
  - message: 'error validating existing CRs agains new CRD''s schema: kabaneros.kabanero.io: error listing resources in GroupVersionResource schema.GroupVersionResource{Group:"kabanero.io", Version:"v1alpha1", Resource:"kabaneros"}: the server could not find the requested resource'

Version-Release number of selected component (if applicable):
4.5.0-rc.7

How reproducible:
Always

Steps to Reproduce:
1. First channel/CSV contains a CRD with two version, one of which is not stored or served
2. Second channel/CSV contains the same CRD but with the not stored/served version removed
3. Switch from first channel to second channel.  Installplan contains the error mentioned above

Actual results:
Well... things get bad, because we also hit https://bugzilla.redhat.com/show_bug.cgi?id=1857877 when the installplan fails.  But the net is that the operator is un-usable after attempting to switch channels.

Expected results:
The channel switch is successful, and the installed CRD now just has a single version.

Additional info:
This appears to be the fix, but I'm unable to test currently:
https://github.com/operator-framework/operator-lifecycle-manager/pull/1659

Comment 7 Tim Kaczynski 2020-07-30 12:41:50 UTC
Hello - I'm not familiar with the process here.  I see there are two needinfo flags set with my name next to them.  Do you need some information from me?

Comment 12 errata-xmlrpc 2020-10-27 16:16:41 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.6 GA Images), 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-2020:4196


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