Bug 1767848

Summary: Setting manual approval strategy ignored for subsequent releases
Product: OpenShift Container Platform Reporter: Bowen Song <bsong>
Component: OLMAssignee: Vu Dinh <vdinh>
OLM sub component: OLM QA Contact: Jian Zhang <jiazha>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: medium CC: bandrade, ecordell, jiazha, scolange, scuppett, vdinh
Version: 4.2.0   
Target Milestone: ---   
Target Release: 4.2.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1767846
: 1796118 (view as bug list) Environment:
Last Closed: 2019-12-03 22:43:11 UTC Type: ---
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: 1758008    
Bug Blocks: 1796118    

Comment 1 Jian Zhang 2019-11-21 08:23:03 UTC
Cluster version is 4.2.0-0.nightly-2019-11-19-194213
mac:~ jianzhang$ oc exec catalog-operator-6b7cf8f8fc-8dvpn -- olm --version
OLM version: 0.11.0
git commit: 34c5c301b63d0d086ea5aa3153bb6c876ecd7ea8

1, Create a subscription with the manual approval policy, as follows:
mac:~ jianzhang$ cat sub-42-manual.yaml 
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: etcd-manual
  namespace: openshift-operators
spec:
  channel: clusterwide-alpha
  installPlanApproval: Manual
  name: etcd
  source: community-operators
  sourceNamespace: openshift-marketplace
  startingCSV: etcdoperator.v0.9.2-clusterwide
mac:~ jianzhang$ oc create -f sub-42-manual.yaml 
subscription.operators.coreos.com/etcd-manual created
mac:~ jianzhang$ oc get sub -A
NAMESPACE             NAME          PACKAGE   SOURCE                CHANNEL
openshift-operators   etcd-manual   etcd      community-operators   clusterwide-alpha

2, Check its InstallPlan and approve it.
mac:~ jianzhang$ oc get ip -n openshift-operators
NAME            CSV                               APPROVAL   APPROVED
install-58w2j   etcdoperator.v0.9.2-clusterwide   Manual     false
mac:~ jianzhang$ oc edit ip install-58w2j -n openshift-operators
installplan.operators.coreos.com/install-58w2j edited
mac:~ jianzhang$ oc get ip -n openshift-operators
NAME            CSV                               APPROVAL   APPROVED
install-58w2j   etcdoperator.v0.9.2-clusterwide   Manual     true
install-skvgx   etcdoperator.v0.9.4-clusterwide   Manual     false
mac:~ jianzhang$ oc get csv -n openshift-operators
NAME                              DISPLAY   VERSION             REPLACES              PHASE
etcdoperator.v0.9.2-clusterwide   etcd      0.9.2-clusterwide   etcdoperator.v0.9.0   Succeeded

As we can see from above, the following InstallPlan(install-skvgx) doesn't get approval automatically. LGTM. 

3, Approve it manually. The newer version has been installed. Verify it.
mac:~ jianzhang$ oc get ip -n openshift-operators
NAME            CSV                               APPROVAL   APPROVED
install-58w2j   etcdoperator.v0.9.2-clusterwide   Manual     true
install-skvgx   etcdoperator.v0.9.4-clusterwide   Manual     true

mac:~ jianzhang$ oc get csv -n openshift-operators
NAME                              DISPLAY   VERSION             REPLACES                          PHASE
etcdoperator.v0.9.2-clusterwide   etcd      0.9.2-clusterwide   etcdoperator.v0.9.0               Replacing
etcdoperator.v0.9.4-clusterwide   etcd      0.9.4-clusterwide   etcdoperator.v0.9.2-clusterwide   Installing

mac:~ jianzhang$ oc get csv -n openshift-operators
NAME                              DISPLAY   VERSION             REPLACES                          PHASE
etcdoperator.v0.9.4-clusterwide   etcd      0.9.4-clusterwide   etcdoperator.v0.9.2-clusterwide   Succeeded

Comment 3 errata-xmlrpc 2019-12-03 22:43:11 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, 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-2019:3953