Bug 1719958 - oc get clusterversion does not list version when there is an error state on update
Summary: oc get clusterversion does not list version when there is an error state on u...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Cluster Version Operator
Version: 4.1.z
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: 4.1.z
Assignee: Clayton Coleman
QA Contact: liujia
URL:
Whiteboard: 4.1.6
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-06-12 19:52 UTC by Clayton Coleman
Modified: 2019-07-23 18:12 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-07-23 18:12:07 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:1766 0 None None None 2019-07-23 18:12:15 UTC

Description Clayton Coleman 2019-06-12 19:52:22 UTC
If the CVO is updating to a new version but hits an error, `oc get clusterversion` prints no value in the status column because the CRD is viewing the wrong object.

Instead, use the first entry in the history list which is always the "desired" or "completed" version.

https://github.com/openshift/cluster-version-operator/pull/189 merged to master right after 4.2 branch but before 4.1.  This fix should be in 4.1.z to ensure users aren't confused during upgrades.

Comment 2 liujia 2019-07-04 06:23:08 UTC
Reproduce on 4.1.0-0.nightly-2019-05-05-070156

Steps:
1. Install cluster with 4.1.0-0.nightly-2019-05-05-070156 nightly build.
2. Run "oc adm upgrade --to-image=registry.svc.ci.openshift.org/ocp/release:4.1.0-0.nightly-2019-06-27-201210" to do upgrade, but failed due to image signature
3. Check the version column is empty in "oc get clusterversion" output, and so is the desiredUpdate in clusterversion.
# oc get clusterversion
NAME      VERSION   AVAILABLE   PROGRESSING   SINCE   STATUS
version             True        True          7s      Unable to apply registry.svc.ci.openshift.org/ocp/release:4.1.0-0.nightly-2019-06-27-201210: the image may not be safe to use

# oc get clusterversion -o json|jq ".items[0].spec"
{
  "channel": "stable-4.1",
  "clusterID": "9d2ccb4c-64a6-468a-8009-f4d318753a8e",
  "desiredUpdate": {
    "image": "registry.svc.ci.openshift.org/ocp/release:4.1.0-0.nightly-2019-06-27-201210",
    "version": ""
  },
  "upstream": "https://api.openshift.com/api/upgrades_info/v1/graph"
}

Comment 3 liujia 2019-07-04 07:06:23 UTC
Verified on 4.1.0-0.nightly-2019-07-03-205519

# oc get clusterversion
NAME      VERSION                             AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.1.0-0.nightly-2019-07-03-205519   True        True          5s      Unable to apply registry.svc.ci.openshift.org/ocp/release:4.1.0-0.nightly-2019-07-03-035331: the image may not be safe to use

# oc get clusterversion -o json|jq '.items[0].status.history'
[
  {
    "completionTime": null,
    "image": "registry.svc.ci.openshift.org/ocp/release:4.1.0-0.nightly-2019-07-03-035331",
    "startedTime": "2019-07-04T06:58:26Z",
    "state": "Partial",
    "verified": false,
    "version": ""
  },
  {
    "completionTime": "2019-07-04T06:58:26Z",
    "image": "registry.svc.ci.openshift.org/ocp/release@sha256:58dfc409525884a606e5cc814e10c849544ed885e3e5fbb118f4deab3059465f",
    "startedTime": "2019-07-04T06:40:38Z",
    "state": "Completed",
    "verified": false,
    "version": "4.1.0-0.nightly-2019-07-03-205519"
  }
]

Comment 5 errata-xmlrpc 2019-07-23 18:12:07 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:1766


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