Bug 1906335 - The lastTransitionTime, message, reason field of operatorcondition should be optional
Summary: The lastTransitionTime, message, reason field of operatorcondition should be ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: OLM
Version: 4.7
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.7.0
Assignee: Alexander Greene
QA Contact: Jian Zhang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-12-10 09:55 UTC by Jian Zhang
Modified: 2021-02-24 15:42 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: The lastTransitionTime was required when overriding an OperatorCondition. Consequence: The feature was difficult to use as users were forced to provide a timestamp when overriding an OperatorCondition. Fix: The lastTransitionTime field is no longer required when overriding an OperatorCondition. Result: Users no longer need to provide a lastTransitionTime when overriding an OperatorCondition.
Clone Of:
Environment:
Last Closed: 2021-02-24 15:41:51 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 1903 0 None closed Bug 1908471: Bump deps k8s 1.20 2021-02-11 18:00:41 UTC
Red Hat Product Errata RHSA-2020:5633 0 None None None 2021-02-24 15:42:14 UTC

Description Jian Zhang 2020-12-10 09:55:35 UTC
Description of problem:
Get the below limitation when updating an OperatorCondition resource.
# Please edit the object below. Lines beginning with a '#' will be ignored,
# and an empty file will abort the edit. If an error occurs while saving this file will be
# reopened with the relevant failures.
#
# operatorconditions.operators.coreos.com "etcdoperator.v0.9.4" was not valid:
# * spec.overrides.lastTransitionTime: Required value
# * spec.overrides.message: Required value
# * spec.overrides.reason: Required value

As the https://github.com/operator-framework/olm-docs/blob/master/content/en/docs/advanced-tasks/communicating-operator-conditions-to-olm.md#example-override shows, these below fields should be optional, not required

# * spec.overrides.lastTransitionTime: Required value
# * spec.overrides.message: Required value
# * spec.overrides.reason: Required value


Version-Release number of selected component (if applicable):
Cluster version is 4.7.0-0.nightly-2020-12-09-112139
[root@preserve-olm-env data]# oc -n openshift-operator-lifecycle-manager exec catalog-operator-5bff7985dc-qmnqk -- olm --version
OLM version: 0.17.0
git commit: 2294bcc907c834c160c5b99fbf15988d0706853c

How reproducible:
always

Steps to Reproduce:
1. Install OCP 4.7.
2. Subscribe an operator, such as, etcd
[root@preserve-olm-env data]# oc get sub -A
NAMESPACE              NAME                            PACKAGE               SOURCE                CHANNEL
default                etcd                            etcd                  community-operators   singlenamespace-alpha
[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

3. Add the `overrides` to this operatorcondition resource manually.
[root@preserve-olm-env data]# oc get operatorcondition
NAME                  AGE
etcdoperator.v0.9.4   6h23m
[root@preserve-olm-env data]# oc edit operatorcondition etcdoperator.v0.9.4
...


Actual results:
Get the below limations:
# operatorconditions.operators.coreos.com "etcdoperator.v0.9.4" was not valid:
# * spec.overrides.lastTransitionTime: Required value
# * spec.overrides.message: Required value
# * spec.overrides.reason: Required value

Expected results:
All the above fields should be optional, not required, especially the `lastTransitionTime` filed.

Additional info:

Comment 1 Alexander Greene 2020-12-16 20:49:15 UTC
This will no longer be required once the changes introduced to the CRD in this PR [1] are pulled into OLM, which will happen as a part of the kube dependency bump [2].

Ref:
[1] https://github.com/operator-framework/api/pull/91
[2] https://github.com/operator-framework/operator-lifecycle-manager/pull/1903

Comment 2 Alexander Greene 2020-12-16 20:49:54 UTC
I am not marking the message or reason fields as optional because I believe they should be required.

Comment 3 Alexander Greene 2020-12-16 20:54:47 UTC
I have updated the example documentation in this PR: https://github.com/operator-framework/olm-docs/pull/90

Comment 4 Alexander Greene 2020-12-23 16:31:28 UTC
The PR linked to this ticket has been merged fixing the issue.

Comment 8 Jian Zhang 2021-01-05 10:45:38 UTC
Cluster version is 4.7.0-0.nightly-2021-01-04-215816
[root@preserve-olm-env data]# oc -n openshift-operator-lifecycle-manager  exec catalog-operator-5b4b6587c4-2qgfb -- olm --version
OLM version: 0.17.0
git commit: 69dc076d610b033d3964ed40c4ac27ece3424851

It works as expected. Verify it.
[root@preserve-olm-env data]# oc edit operatorcondition etcdoperator.v0.9.4
operatorcondition.operators.coreos.com/etcdoperator.v0.9.4 edited
...
  overrides:
  - message: This is a known issue with the operator where it always reports that it cannot be upgraded.
    reason: upgradeIsSafe
    status: "True"
    type: Upgradeable


# operatorconditions.operators.coreos.com "etcdoperator.v0.9.4" was not valid:
# * spec.overrides.message: Required value
# * spec.overrides.reason: Required value
# * spec.overrides.status: Required value

Comment 11 errata-xmlrpc 2021-02-24 15:41:51 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.

https://access.redhat.com/errata/RHSA-2020:5633


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