Bug 1859717

Summary: Cannot remove a version from CRD during operator upgrade
Product: OpenShift Container Platform Reporter: Tim Kaczynski <kaczynsk>
Component: OLMAssignee: Evan Cordell <ecordell>
OLM sub component: OLM QA Contact: kuiwang
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: medium CC: jiazha, nhale
Version: 4.5Flags: kuiwang: needinfo-
kuiwang: needinfo-
kaczynsk: needinfo-
kaczynsk: needinfo-
Target Milestone: ---   
Target Release: 4.6.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: 2020-10-27 16:16:41 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:
Attachments:
Description Flags
Failing installplan none

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