Bug 1686121

Summary: [marketplace] Operator is incorrectly reporting status and version in ClusterOperator
Product: OpenShift Container Platform Reporter: Alexander Greene <agreene>
Component: OLMAssignee: Alexander Greene <agreene>
Status: CLOSED ERRATA QA Contact: Fan Jia <jfan>
Severity: medium Docs Contact:
Priority: high    
Version: 4.1.0CC: aravindh, jiazha, juzhao, sponnaga
Target Milestone: ---Keywords: BetaBlocker
Target Release: 4.1.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: The marketplace operator would set it's the operator as available and would never report progressing. Additionally, the ClusterOperator version was always set to "0.0.1" instead of the "0.0.1-snapshot", which CVO expects/replaces with the correct payload version. Consequence: The marketplace operator was not correctly reports status and version in it's ClusterOperator. Fix: The Marketplace ClusterOperator will now report progressing is true when the operator starts and report that the operator is available once it reconciles a number of CR's that it is watching. The marketplace ClusterOperator is also created with it's version set to "0.0.1-snapshot", which CVO looks for and replaces with the correct payload version. Result: The marketplace operator now correctly reports status and version in it's ClusterOperator.
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-06-04 10:45:04 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:

Description Alexander Greene 2019-03-06 18:50:24 UTC
Description of problem:
The Marketplace Operator does not update it's clusteroperator to correctly portray the status of the operator.

Issues include:
1. The clusteroperator progress condition is never set to True. This condition should be set to display when a new version of the operator is being rolled out. When the operator has finishes deploying, the progress condition should be set to false and the Available/Failing conditions should be updated to reflect the state of the operator. Currently, the clusterOperator always has the following conditions:
Available = True
Progressing = False
Failing = False

2. The clusteroperator's operator version is set to "0.0.1", when it should actually be set to "0.0.1-snapshot" so the CVO can replace this value.


How reproducible: Always

Steps to Reproduce:
Create an Openshift cluster with the installer.

Comment 1 Fan Jia 2019-03-13 10:12:58 UTC
The content in "Status->Conditions" in the clusteroperator won't update during the cvo update progress. Some cluster operators changed and some didn't.

didn't change clusteroperator list:

operator-lifecycle-manager
openshift-cloud-credential-operator
monitoring
marketplace-operator
machine-api
ingress
image-registry
dns
cluster-storage-operator

Comment 2 Jian Zhang 2019-03-13 10:54:42 UTC
For example, the OLM version is updated after the OTA. But the "conditions" timestamps are not changed.

Before the upgarde:
[jzhang@dhcp-140-18 upgrade-12]$ oc get clusteroperator operator-lifecycle-manager -o yaml
apiVersion: config.openshift.io/v1
kind: ClusterOperator
metadata:
  creationTimestamp: 2019-03-13T03:59:53Z
  generation: 1
  name: operator-lifecycle-manager
  resourceVersion: "7470"
  selfLink: /apis/config.openshift.io/v1/clusteroperators/operator-lifecycle-manager
  uid: 74e476cc-4544-11e9-b378-062e67fbace6
spec: {}
status:
  conditions:
  - lastTransitionTime: 2019-03-13T03:59:53Z
    message: Done deploying 0.8.1.
    status: "False"
    type: Progressing
  - lastTransitionTime: 2019-03-13T03:59:53Z
    message: Done deploying 0.8.1.
    status: "False"
    type: Failing
  - lastTransitionTime: 2019-03-13T03:59:53Z
    message: Done deploying 0.8.1.
    status: "True"
    type: Available
  extension: null
  relatedObjects: null
  versions:
  - name: operator
    version: 0.8.1-416a6f1

After the upgarde:
[jzhang@dhcp-140-18 upgrade-12]$ oc get clusteroperator operator-lifecycle-manager -o yaml
apiVersion: config.openshift.io/v1
kind: ClusterOperator
metadata:
  creationTimestamp: 2019-03-13T03:59:53Z
  generation: 1
  name: operator-lifecycle-manager
  resourceVersion: "275609"
  selfLink: /apis/config.openshift.io/v1/clusteroperators/operator-lifecycle-manager
  uid: 74e476cc-4544-11e9-b378-062e67fbace6
spec: {}
status:
  conditions:
  - lastTransitionTime: 2019-03-13T03:59:53Z
    message: Done deploying 0.8.1.
    status: "False"
    type: Progressing
  - lastTransitionTime: 2019-03-13T03:59:53Z
    message: Done deploying 0.8.1.
    status: "False"
    type: Failing
  - lastTransitionTime: 2019-03-13T03:59:53Z
    message: Done deploying 0.8.1.
    status: "True"
    type: Available
  extension: null
  relatedObjects: null
  versions:
  - name: operator
    version: 0.8.1-ab6342f

Comment 13 Fan Jia 2019-03-20 02:26:19 UTC
one more PR : https://github.com/operator-framework/operator-marketplace/pull/134 for this bug will repair the probalistic measurement to "count of successful syncs ", and now it report the "payload version " as the operator version.
 
will test again after this PR is merged in the nightly build.

Comment 14 Alexander Greene 2019-03-21 16:40:28 UTC
PR https://github.com/operator-framework/operator-marketplace/pull/134 has been merged and is ready for review.

Comment 20 errata-xmlrpc 2019-06-04 10:45:04 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:0758