Bug 1758008 - Setting manual approval strategy ignored for subsequent releases
Summary: Setting manual approval strategy ignored for subsequent releases
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: OLM
Version: 4.2.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.3.0
Assignee: Vu Dinh
QA Contact: Jian Zhang
URL:
Whiteboard:
Depends On:
Blocks: 1767846 1767848 1796118
TreeView+ depends on / blocked
 
Reported: 2019-10-03 00:30 UTC by Vu Dinh
Modified: 2020-05-13 21:26 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1767846 (view as bug list)
Environment:
Last Closed: 2020-05-13 21:26:33 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github operator-framework operator-lifecycle-manager pull 1059 0 'None' closed Bug 1758008: Manual approval strategy ignored for subsequent releases 2021-02-04 12:05:08 UTC
Red Hat Product Errata RHBA-2020:0062 0 None None None 2020-05-13 21:26:38 UTC

Description Vu Dinh 2019-10-03 00:30:34 UTC
Description of problem:
Setting manual approval strategy ignored for subsequent releases

Version-Release number of selected component (if applicable):
4.2

How reproducible:
100%

Steps to Reproduce:
1. define a Subscription with installPlanApproval: Manual and specify older (not latest)   startingCSV
2. approve installing the starting CSV version
3. when it's installed, the latest version is offered with automatic strategy, effectively installing the latest version without user intervention

For example:

$ oc get installplans --all-namespaces
NAMESPACE             NAME            CSV                                          APPROVAL    APPROVED
knative-serving       install-6brjj   serverless-operator.v1.1.0                   Manual      false
knative-serving       install-prx6s   serverless-operator.v1.0.0                   Manual      true 

$ oc get subscription serverless-operator-subscription -n knative-serving -oyaml
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"operators.coreos.com/v1alpha1","kind":"Subscription","metadata":{"annotations":{},"name":"serverless-operator-subscription","namespace":"knative-serving"},"spec":{"channel":"techpreview","installPlanApproval":"Manual","name":"serverless-operator","source":"serverless-operator","sourceNamespace":"openshift-marketplace","startingCSV":"serverless-operator.v1.0.0"}}
  creationTimestamp: "2019-09-27T12:04:57Z"
  generation: 1
  name: serverless-operator-subscription
  namespace: knative-serving
  resourceVersion: "169556"
  selfLink: /apis/operators.coreos.com/v1alpha1/namespaces/knative-serving/subscriptions/serverless-operator-subscription
  uid: 062f7940-e11f-11e9-96a7-023fbd8f3158
spec:
  channel: techpreview
  installPlanApproval: Manual
  name: serverless-operator
  source: serverless-operator
  sourceNamespace: openshift-marketplace
  startingCSV: serverless-operator.v1.0.0
...

Actual results: The upgrade InstallPlan successfully installs the operator despite the approved field remains false (unapproved by user).


Expected results: The upgrade InstallPlan should be stuck in waiting for approval stage until it is approved by user.


Additional info:

Comment 2 Jian Zhang 2019-10-16 02:34:50 UTC
LGTM, verify it, details as below:
Cluster version is 4.3.0-0.nightly-2019-10-15-180816
OLM version:
mac:~ jianzhang$ oc exec catalog-operator-54bd64c64b-5vv8z  -- olm --version
OLM version: 0.12.0
git commit: 586a673cbaab66ff7957359c8c135de38735e367

1, Create the etcd operator 0.9.2 version with Manual approval.
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
NAME          PACKAGE   SOURCE                CHANNEL
etcd-manual   etcd      community-operators   clusterwide-alpha
mac:~ jianzhang$ oc get ip
NAME            CSV                               APPROVAL   APPROVED
install-76xxn   etcdoperator.v0.9.2-clusterwide   Manual     false
mac:~ jianzhang$ oc get csv
No resources found.

2, Approve this InstallPlan.
mac:~ jianzhang$ oc edit ip install-76xxn 
installplan.operators.coreos.com/install-76xxn edited
mac:~ jianzhang$ oc get csv
NAME                              DISPLAY   VERSION             REPLACES              PHASE
etcdoperator.v0.9.2-clusterwide   etcd      0.9.2-clusterwide   etcdoperator.v0.9.0   Installing
mac:~ jianzhang$ oc get ip
NAME            CSV                               APPROVAL   APPROVED
install-76xxn   etcdoperator.v0.9.2-clusterwide   Manual     true
install-j2nbf   etcdoperator.v0.9.4-clusterwide   Manual     false

3, The v0.9.2 etcd operator should be installed, but the v0.9.4 should NOT be installed. LGTM.
mac:~ jianzhang$ oc get sub etcd-manual -o yaml
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  creationTimestamp: "2019-10-16T02:09:12Z"
  generation: 1
  name: etcd-manual
  namespace: openshift-operators
  resourceVersion: "37120"
  selfLink: /apis/operators.coreos.com/v1alpha1/namespaces/openshift-operators/subscriptions/etcd-manual
  uid: 0e999285-8a18-477d-9189-89dfd309c395
spec:
  channel: clusterwide-alpha
  installPlanApproval: Manual
  name: etcd
  source: community-operators
  sourceNamespace: openshift-marketplace
  startingCSV: etcdoperator.v0.9.2-clusterwide
status:
  catalogHealth:
  - catalogSourceRef:
      apiVersion: operators.coreos.com/v1alpha1
      kind: CatalogSource
      name: certified-operators
      namespace: openshift-marketplace
      resourceVersion: "17327"
      uid: 1caf5bce-02d8-4061-b3d0-658a703398be
    healthy: true
    lastUpdated: "2019-10-16T02:09:12Z"
  - catalogSourceRef:
      apiVersion: operators.coreos.com/v1alpha1
      kind: CatalogSource
      name: community-operators
      namespace: openshift-marketplace
      resourceVersion: "17326"
      uid: fb1c2294-ff77-4609-88f2-97bb32c61c11
    healthy: true
    lastUpdated: "2019-10-16T02:09:12Z"
  - catalogSourceRef:
      apiVersion: operators.coreos.com/v1alpha1
      kind: CatalogSource
      name: redhat-operators
      namespace: openshift-marketplace
      resourceVersion: "17340"
      uid: 983ca3dd-5470-4b79-a5fd-fd31b174d437
    healthy: true
    lastUpdated: "2019-10-16T02:09:12Z"
  conditions:
  - lastTransitionTime: "2019-10-16T02:09:12Z"
    message: all available catalogsources are healthy
    reason: AllCatalogSourcesHealthy
    status: "False"
    type: CatalogSourcesUnhealthy
  - lastTransitionTime: "2019-10-16T02:15:59Z"
    reason: RequiresApproval
    status: "True"
    type: InstallPlanPending
  currentCSV: etcdoperator.v0.9.4-clusterwide
  installPlanRef:
    apiVersion: operators.coreos.com/v1alpha1
    kind: InstallPlan
    name: install-j2nbf
    namespace: openshift-operators
    resourceVersion: "37104"
    uid: 9c7be78d-c33e-4f29-aa61-c1837e8b2a18
  installedCSV: etcdoperator.v0.9.2-clusterwide
  installplan:
    apiVersion: operators.coreos.com/v1alpha1
    kind: InstallPlan
    name: install-j2nbf
    uuid: 9c7be78d-c33e-4f29-aa61-c1837e8b2a18
  lastUpdated: "2019-10-16T02:15:59Z"
  state: UpgradePending
mac:~ jianzhang$ oc get ip
NAME            CSV                               APPROVAL   APPROVED
install-76xxn   etcdoperator.v0.9.2-clusterwide   Manual     true
install-j2nbf   etcdoperator.v0.9.4-clusterwide   Manual     false
mac:~ jianzhang$ oc get csv
NAME                              DISPLAY   VERSION             REPLACES              PHASE
etcdoperator.v0.9.2-clusterwide   etcd      0.9.2-clusterwide   etcdoperator.v0.9.0   Succeeded

4, Approve the v0.9.4 InstallPlan.
mac:~ jianzhang$ oc edit ip install-j2nbf  
installplan.operators.coreos.com/install-j2nbf edited

mac:~ jianzhang$ oc get ip
NAME            CSV                               APPROVAL   APPROVED
install-76xxn   etcdoperator.v0.9.2-clusterwide   Manual     true
install-j2nbf   etcdoperator.v0.9.4-clusterwide   Manual     true
mac:~ jianzhang$ oc get csv
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

5, The v0.9.4 should be installed, LGTM.
mac:~ jianzhang$ oc get csv
NAME                              DISPLAY   VERSION             REPLACES                          PHASE
etcdoperator.v0.9.4-clusterwide   etcd      0.9.4-clusterwide   etcdoperator.v0.9.2-clusterwide   Succeeded

mac:~ jianzhang$ oc get sub etcd-manual -o yaml
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  creationTimestamp: "2019-10-16T02:09:12Z"
  generation: 1
  name: etcd-manual
  namespace: openshift-operators
  resourceVersion: "46250"
  selfLink: /apis/operators.coreos.com/v1alpha1/namespaces/openshift-operators/subscriptions/etcd-manual
  uid: 0e999285-8a18-477d-9189-89dfd309c395
spec:
  channel: clusterwide-alpha
  installPlanApproval: Manual
  name: etcd
  source: community-operators
  sourceNamespace: openshift-marketplace
  startingCSV: etcdoperator.v0.9.2-clusterwide
status:
  catalogHealth:
  - catalogSourceRef:
      apiVersion: operators.coreos.com/v1alpha1
      kind: CatalogSource
      name: certified-operators
      namespace: openshift-marketplace
      resourceVersion: "17327"
      uid: 1caf5bce-02d8-4061-b3d0-658a703398be
    healthy: true
    lastUpdated: "2019-10-16T02:09:12Z"
  - catalogSourceRef:
      apiVersion: operators.coreos.com/v1alpha1
      kind: CatalogSource
      name: community-operators
      namespace: openshift-marketplace
      resourceVersion: "17326"
      uid: fb1c2294-ff77-4609-88f2-97bb32c61c11
    healthy: true
    lastUpdated: "2019-10-16T02:09:12Z"
  - catalogSourceRef:
      apiVersion: operators.coreos.com/v1alpha1
      kind: CatalogSource
      name: redhat-operators
      namespace: openshift-marketplace
      resourceVersion: "17340"
      uid: 983ca3dd-5470-4b79-a5fd-fd31b174d437
    healthy: true
    lastUpdated: "2019-10-16T02:09:12Z"
  conditions:
  - lastTransitionTime: "2019-10-16T02:09:12Z"
    message: all available catalogsources are healthy
    reason: AllCatalogSourcesHealthy
    status: "False"
    type: CatalogSourcesUnhealthy
  currentCSV: etcdoperator.v0.9.4-clusterwide
  installPlanRef:
    apiVersion: operators.coreos.com/v1alpha1
    kind: InstallPlan
    name: install-j2nbf
    namespace: openshift-operators
    resourceVersion: "37104"
    uid: 9c7be78d-c33e-4f29-aa61-c1837e8b2a18
  installedCSV: etcdoperator.v0.9.4-clusterwide
  installplan:
    apiVersion: operators.coreos.com/v1alpha1
    kind: InstallPlan
    name: install-j2nbf
    uuid: 9c7be78d-c33e-4f29-aa61-c1837e8b2a18
  lastUpdated: "2019-10-16T02:27:40Z"
  state: AtLatestKnown

Comment 4 errata-xmlrpc 2020-05-13 21:26:33 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-2020:0062


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