Bug 1909640 - The `Upgradeable` of the OperatorCondition failed to block the operator upgrading
Summary: The `Upgradeable` of the OperatorCondition failed to block the operator upgra...
Keywords:
Status: CLOSED DUPLICATE of bug 1907792
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: OLM
Version: 4.7
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ---
Assignee: Evan Cordell
QA Contact: Jian Zhang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-12-21 09:24 UTC by Jian Zhang
Modified: 2020-12-21 18:27 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-12-21 18:27:24 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Jian Zhang 2020-12-21 09:24:12 UTC
Description of problem:
The status of the Upgradeable is False, but this etcdoperatorv0.9.2 can be upgraded to 0.9.4 successfully
[root@preserve-olm-env data]# oc get operatorcondition etcdoperator.v0.9.2 -o yaml
apiVersion: operators.coreos.com/v1
kind: OperatorCondition
...
status:
  conditions:
  - lastTransitionTime: "2020-12-17T15:39:01Z"
    message: Test
    reason: NotUpgradeable
    status: "False"
    type: Upgradeable



Version-Release number of selected component (if applicable):
[root@preserve-olm-env data]# oc version
Client Version: 4.7.0-0.nightly-2020-12-16-224526
Server Version: 4.7.0-0.nightly-2020-12-20-031835
Kubernetes Version: v1.20.0+87544c5
[root@preserve-olm-env data]# oc -n openshift-operator-lifecycle-manager  exec catalog-operator-7c9b666d58-2clj6 -- olm --version
OLM version: 0.17.0
git commit: ffb66b0f4150bb82cbc6a1e7571901fe7724f91e

How reproducible:
always

Steps to Reproduce:
1. Create a CatalogSource that contains the etcdoperator v0.9.2 and v0.9.4
[root@preserve-olm-env data]# cat cs-etcd.yaml 
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: etcd-test
  namespace: openshift-marketplace
spec:
  displayName: Jian Test
  publisher: Jian
  sourceType: grpc
  image: quay.io/olmqe/etcd-index:0.9.2-oc
  updateStrategy:
    registryPoll:
      interval: 10m
[root@preserve-olm-env data]# oc create -f cs-etcd.yaml 
catalogsource.operators.coreos.com/etcd-test created
[root@preserve-olm-env data]# oc get packagemanifest|grep etcd
etcd                                                 Jian Test              3m7s

2. Create the OperatorGroup and subscribe to the etcdoperator 0.9.2 version with Manual approval.
[root@preserve-olm-env data]# cat og.yaml 
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
  name: test-og
  namespace: default
spec:
  targetNamespaces:
  - default
[root@preserve-olm-env data]# oc  create -f og.yaml 
operatorgroup.operators.coreos.com/test-og created


3. Approve the v0.9.2.
[root@preserve-olm-env data]# oc get csv
NAME                  DISPLAY   VERSION   REPLACES   PHASE
etcdoperator.v0.9.2   etcd      0.9.2                Succeeded


4, Update the Upgradable of the OperatorCondition to False.
[root@preserve-olm-env data]# oc proxy --port=8081 &
[1] 17731
[root@preserve-olm-env data]# Starting to serve on 127.0.0.1:8081

[root@preserve-olm-env data]# curl -X PATCH -H 'Content-Type: application/merge-patch+json' --data '{"status":{"conditions":[
> 
> {"lastTransitionTime":"2020-12-17T15:39:01Z","message":"Test","reason":"NotUpgradeable","status":"False","type":"Upgradeable"}
> ]}}' localhost:8081/apis/operators.coreos.com/v1/namespaces/default/operatorconditions/etcdoperator.v0.9.2/status
{"apiVersion":"operators.coreos.com/v1","kind":"OperatorCondition","metadata":{"creationTimestamp":"2020-12-21T08:56:02Z","generation":1,"labels":{"operators.coreos.com/etcd.default":""},"managedFields":[{"apiVersion":"operators.coreos.com/v1","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:labels":{".":{},"f:operators.coreos.com/etcd.default":{}},"f:ownerReferences":{".":{},"k:{\"uid\":\"6a7d3bab-4d82-4548-9f46-08ed6a28370d\"}":{".":{},"f:apiVersion":{},"f:blockOwnerDeletion":{},"f:controller":{},"f:kind":{},"f:name":{},"f:uid":{}}}},"f:spec":{".":{},"f:deployments":{},"f:serviceAccounts":{}}},"manager":"olm","operation":"Update","time":"2020-12-21T08:56:03Z"},{"apiVersion":"operators.coreos.com/v1","fieldsType":"FieldsV1","fieldsV1":{"f:status":{".":{},"f:conditions":{}}},"manager":"curl","operation":"Update","time":"2020-12-21T08:58:06Z"}],"name":"etcdoperator.v0.9.2","namespace":"default","ownerReferences":[{"apiVersion":"operators.coreos.com/v1alpha1","blockOwnerDeletion":false,"controller":true,"kind":"ClusterServiceVersion","name":"etcdoperator.v0.9.2","uid":"6a7d3bab-4d82-4548-9f46-08ed6a28370d"}],"resourceVersion":"170663","uid":"b228375c-74ea-4790-b494-1dba88387e02"},"spec":{"deployments":["etcd-operator"],"serviceAccounts":["etcd-operator"]},"status":{"conditions":[{"lastTransitionTime":"2020-12-17T15:39:01Z","message":"Test","reason":"NotUpgradeable","status":"False","type":"Upgradeable"}]}}

[root@preserve-olm-env data]# oc get operatorcondition etcdoperator.v0.9.2 -o yaml
apiVersion: operators.coreos.com/v1
kind: OperatorCondition
metadata:
...
  name: etcdoperator.v0.9.2
  namespace: default
spec:
  deployments:
  - etcd-operator
  serviceAccounts:
  - etcd-operator
status:
  conditions:
  - lastTransitionTime: "2020-12-17T15:39:01Z"
    message: Test
    reason: NotUpgradeable
    status: "False"
    type: Upgradeable


5, Approve the v0.9.4.


Actual results:
The v0.9.4 installed successfully. The operatorcondition  etcdoperator.v0.9.2 was removed.
[root@preserve-olm-env data]# oc get csv
NAME                  DISPLAY   VERSION   REPLACES              PHASE
etcdoperator.v0.9.2   etcd      0.9.2                           Replacing
etcdoperator.v0.9.4   etcd      0.9.4     etcdoperator.v0.9.2   Installing
[root@preserve-olm-env data]# oc get csv
NAME                  DISPLAY   VERSION   REPLACES              PHASE
etcdoperator.v0.9.4   etcd      0.9.4     etcdoperator.v0.9.2   Succeeded


Expected results:
The v0.9.2 should be blocked to v0.9.4.

Additional info:
[root@preserve-olm-env data]# oc get operatorcondition
NAME                  AGE
etcdoperator.v0.9.4   24m

[root@preserve-olm-env data]# oc get operatorcondition etcdoperator.v0.9.4 -o yaml
apiVersion: operators.coreos.com/v1
kind: OperatorCondition
metadata:
  creationTimestamp: "2020-12-21T08:59:02Z"
  generation: 1
  labels:
    operators.coreos.com/etcd.default: ""
  managedFields:
  - apiVersion: operators.coreos.com/v1
    fieldsType: FieldsV1
    fieldsV1:
      f:metadata:
        f:labels:
          .: {}
          f:operators.coreos.com/etcd.default: {}
        f:ownerReferences:
          .: {}
          k:{"uid":"8a10f5b2-7976-48b9-a933-a063782d86a6"}:
            .: {}
            f:apiVersion: {}
            f:blockOwnerDeletion: {}
            f:controller: {}
            f:kind: {}
            f:name: {}
            f:uid: {}
      f:spec:
        .: {}
        f:deployments: {}
        f:serviceAccounts: {}
      f:status: {}
    manager: olm
    operation: Update
    time: "2020-12-21T08:59:03Z"
  name: etcdoperator.v0.9.4
  namespace: default
  ownerReferences:
  - apiVersion: operators.coreos.com/v1alpha1
    blockOwnerDeletion: false
    controller: true
    kind: ClusterServiceVersion
    name: etcdoperator.v0.9.4
    uid: 8a10f5b2-7976-48b9-a933-a063782d86a6
  resourceVersion: "171167"
  uid: 2e7020de-9069-4563-9db3-2d4f3ae5cd85
spec:
  deployments:
  - etcd-operator
  serviceAccounts:
  - etcd-operator

Comment 1 Nick Hale 2020-12-21 18:27:24 UTC

*** This bug has been marked as a duplicate of bug 1907792 ***


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