Bug 1713262 - "oc adm upgrade --to-latest=true" did not update cluster to latest available version
Summary: "oc adm upgrade --to-latest=true" did not update cluster to latest available ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Cluster Version Operator
Version: 4.1.0
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: ---
: 4.1.z
Assignee: W. Trevor King
QA Contact: liujia
URL:
Whiteboard: 4.1.4
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-05-23 09:44 UTC by liujia
Modified: 2019-07-04 09:01 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-04 09:01:24 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Github openshift origin pull 22897 None closed Bug 1713262: pkg/oc/cli/admin/upgrade: Fix and test sortSemanticVersions 2020-08-03 12:49:29 UTC
Red Hat Product Errata RHBA-2019:1635 None None None 2019-07-04 09:01:33 UTC

Description liujia 2019-05-23 09:44:15 UTC
Description of problem:
Run "oc adm upgrade --to-latest=true" to manually update current cluster to latest available version, but it dose not choose the actual "latest" version in the list.

Checked 4.1 nightly builds on https://openshift-release.svc.ci.openshift.org/, the top three is as following(4.1.0-0.nightly-2019-05-22-190823 should be latest):

Name	Phase	Started	Tests	Upgrades
4.1.0-0.nightly-2019-05-22-190823	Accepted	13 hours ago	aws aws-serial			4.1.0-rc.5
4.1.0-0.nightly-2019-05-22-050858	Accepted	1 day ago	aws aws-serial			4.1.0-rc.5
4.1.0-0.nightly-2019-05-21-060354	Accepted	2 days ago	aws aws-serial			4.1.0-rc.5

[root@preserve-jliu-worker 20190523_15261]# ./oc adm upgrade
Cluster version is 4.1.0-rc.5

Updates:

VERSION                           IMAGE
4.1.0-0.nightly-2019-05-21-060354 registry.svc.ci.openshift.org/ocp/release@sha256:65236cc32eb9972f661aecd7da4f3bfba61414c0c26730ea85549378c6c08d3e
4.1.0-0.nightly-2019-05-22-190823 registry.svc.ci.openshift.org/ocp/release@sha256:bd0af072c542d6a4aa614151a6caf9f69a197b33e0f57dc180ea795a7baf0159
4.1.0-0.nightly-2019-05-22-050858 registry.svc.ci.openshift.org/ocp/release@sha256:29e03d18fb7fe375bc5d103f22df3343fc40843a6acfbb52b785b7f3aee3921f

[root@preserve-jliu-worker 20190523_15261]# ./oc adm upgrade --to-latest=true
Updating to latest version 4.1.0-0.nightly-2019-05-22-050858

[root@preserve-jliu-worker 20190523_15261]# oc get clusterversion -o json|jq ".items[0].spec"
{
  "channel": "stable-4.1",
  "clusterID": "0ba7c984-7295-4158-b899-53a0fbcb8a24",
  "desiredUpdate": {
    "force": false,
    "image": "registry.svc.ci.openshift.org/ocp/release@sha256:29e03d18fb7fe375bc5d103f22df3343fc40843a6acfbb52b785b7f3aee3921f",
    "version": "4.1.0-0.nightly-2019-05-22-050858"
  },
  "upstream": "https://openshift-release.svc.ci.openshift.org/graph"
}


Version-Release number of the following components:
4.1.0-rc.5

How reproducible:
always

Steps to Reproduce:
1. Run "# ./oc adm upgrade --to-latest=true" to update current cluster to latest available version(there should be more than 1 payload in the list)
2.
3.

Actual results:
"--to-latest=true" did not update cluster to latest available version 

Expected results:
Should choose the latest build as desiredUpdate

Additional info:
Please attach logs from ansible-playbook with the -vvv flag

Comment 1 W. Trevor King 2019-05-23 12:06:29 UTC
Good catch.  There's a missing != here [1].  I'll file a fix in a few hours if nobody else has time before that ;).

[1]: https://github.com/openshift/origin/blob/63800253b3ad38ee1dfa5059e8db1cfee6e3190c/pkg/oc/cli/admin/upgrade/upgrade.go#L346

Comment 2 W. Trevor King 2019-05-23 12:39:11 UTC
This was eating at me, so I just went ahead and worked up the master PR: https://github.com/openshift/origin/pull/22893  Bot will cherry-pick back to 4.1 when the master PR lands.

Comment 4 W. Trevor King 2019-05-23 17:27:10 UTC
4.1 backport: https://github.com/openshift/origin/pull/22897

Comment 8 errata-xmlrpc 2019-07-04 09:01:24 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:1635


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