Bug 1841175

Summary: When an Install Plan gets deleted, OLM does not create a new one
Product: OpenShift Container Platform Reporter: Peter Braun <pbraun>
Component: OLMAssignee: Vu Dinh <vdinh>
OLM sub component: OLM QA Contact: Jian Zhang <jiazha>
Status: CLOSED ERRATA Docs Contact:
Severity: high    
Priority: low CC: dfroehli, dsover, krizza, ltitov, mbagga, nhale, pbrookes, rekhan, vdinh
Version: 4.4   
Target Milestone: ---   
Target Release: 4.7.0   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: Enhancement
Doc Text:
Feature: Create a new InstallPlan if the previous pending InstallPlan is deleted Reason: Deleting an InstallPlan that is waiting for user approval will cause the operator to be stuck in unrecoverable state as the operator installation can't be completed Result: OLM will create a new InstallPlan to replace the deleted one, allow users to approve the new InstallPlan and proceed with the operator installation.
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-02-24 15:12:15 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:
Bug Depends On:    
Bug Blocks: 1899747    

Description Peter Braun 2020-05-28 14:43:51 UTC
Description of problem:

When an InstallPlan is deleted, OLM currently does nothing. We would have expected it to check the latest available CSV again and create a new InstallPlan based on that.

How reproducible:

Every time.

Steps to Reproduce:
1. Install an Operator (that you have controll over) through OLM
2. Push an update for the operator
3. OLM finds the update and awaits for your approval.
4. Do not approve, instead delete the install plan

Actual results:

OLM does not create a new InstallPlan.

Expected results:

OLM creates a new InstallPlan based on the latest CSV.

Comment 1 Daniel Sover 2020-05-28 15:18:46 UTC
*** Bug 1841179 has been marked as a duplicate of this bug. ***

Comment 3 Vu Dinh 2020-05-28 17:14:55 UTC
This seems to reach a rare case when there is a pending-approval (manually) installplan and user deletes it and OLM fails to reconcile and recreate the installplan for some reason.

Comment 5 Peter Braun 2020-06-02 15:36:05 UTC
Is OLM supposed to create a new InstallPlan already? In that case, maybe I just didn't wait long enough (a few minutes)?

Comment 8 Kevin Rizza 2020-06-19 13:23:13 UTC
*** Bug 1843394 has been marked as a duplicate of this bug. ***

Comment 10 Nick Hale 2020-07-23 16:03:59 UTC
After some discussion, we've determined that a missing InstallPlan shouldn't be terminal state for a Subscription. We'll fix this in the upcoming sprint at the latest.

Comment 13 Daniel Sover 2020-09-08 14:17:31 UTC
*** Bug 1876501 has been marked as a duplicate of this bug. ***

Comment 19 Jian Zhang 2020-11-23 03:36:44 UTC
Cluster version is 4.7.0-0.nightly-2020-11-22-204912

[root@preserve-olm-env data]# oc -n openshift-operator-lifecycle-manager  exec catalog-operator-757d4dd574-splbt -- olm --version
OLM version: 0.17.0
git commit: 3cb2cfd3cb7122f1b740787c7150852fcbd26371

1, Create an operator.
[root@preserve-olm-env data]# oc get sub -n default
etcd   etcd      community-operators   singlenamespace-alpha
[root@preserve-olm-env data]# oc get ip -n default
NAME            CSV                   APPROVAL   APPROVED
install-hzlrl   etcdoperator.v0.9.4   Manual     false
[root@preserve-olm-env data]# oc get csv -n default
No resources found in default namespace.

2, Delete this unapproved InstallPlan.
[root@preserve-olm-env data]# oc delete ip install-hzlrl -n default
installplan.operators.coreos.com "install-hzlrl" deleted

A new InstallPlan generated, LGTM.
[root@preserve-olm-env data]# oc get ip -n default
NAME            CSV                   APPROVAL   APPROVED
install-426cr   etcdoperator.v0.9.4   Manual     false

3, Approve it and delete the approved InstallPlan.
[root@preserve-olm-env data]# oc get ip -n default
NAME            CSV                   APPROVAL   APPROVED
install-426cr   etcdoperator.v0.9.4   Manual     true
[root@preserve-olm-env data]# oc get csv -n default
NAME                  DISPLAY   VERSION   REPLACES              PHASE
etcdoperator.v0.9.4   etcd      0.9.4     etcdoperator.v0.9.2   Succeeded

[root@preserve-olm-env data]# oc delete ip install-426cr -n default
installplan.operators.coreos.com "install-426cr" deleted

[root@preserve-olm-env data]# oc get ip -n default
No resources found in default namespace.

The approved InstallPlan will not be recreated. LGTM, verify it.

Comment 22 errata-xmlrpc 2021-02-24 15:12:15 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.7.0 security, bug fix, and enhancement 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.