Bug 2044228

Summary: --allow-not-recommended does not work with oc adm upgrade –to-latest
Product: OpenShift Container Platform Reporter: Yang Yang <yanyang>
Component: ocAssignee: Lalatendu Mohanty <lmohanty>
oc sub component: oc QA Contact: Yang Yang <yanyang>
Status: VERIFIED --- Docs Contact:
Severity: low    
Priority: low CC: aos-bugs, mfojtik, wking
Version: 4.10   
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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 Yang Yang 2022-01-24 09:26:15 UTC
Description of problem:

When a cluster has recommended updates, as well as conditional updates, oc adm upgrade --to-latest --allow-not-recommended ignores the conditional updates and updates it to the latest one in recommended updates. 

# oc adm upgrade --to-latest --allow-not-recommended
Updating to latest version 4.10.0-0.nightly-2022-01-22-102609


# oc adm upgrade --include-not-recommended
Cluster version is 4.10.0-0.nightly-2022-01-21-231627

Upstream: https://raw.githubusercontent.com/shellyyang1989/upgrade-cincy/master/cincy-conditional-edge.json
Channel: buggy

Recommended updates:

  VERSION                            IMAGE
  4.10.0-0.nightly-2022-01-22-102609 registry.ci.openshift.org/ocp/release@sha256:4c60e2573cad9cfccc9185e13e7a9ca4a9f6fd075549ee3b51bd88639ba1eaba

Supported but not recommended updates:

  Version: 4.10.0-0.nightly-2022-01-22-143400
  Image: registry.ci.openshift.org/ocp/release@sha256:f1b711b1f476d021d0bdc2b88cd28d5b92e4459b49c787db2129c6c1aaf26652
  Recommended: False
  Reason: ReleaseIsRejected
  Message: Too many CI failures on this release, so do not update to it https://openshift-release.apps.ci.l2s4.p1.openshiftapps.com/releasestream/4.10.0-0.nightly/release/4.10.0-0.nightly-2021-11-24-075634

  Version: 4.10.0-0.nightly-2022-01-22-062609
  Image: registry.ci.openshift.org/ocp/release@sha256:e787a6778000d199767cc365e6241345648346c4e7956a45d4344395ccf591ff
  Recommended: False
  Reason: MultipleReasons
  Message: On clusters on default invoker user, this imaginary bug can happen. https://bug.example.com/a
  
  On clusters with the channel set to 'buggy', this imaginary bug can happen. https://bug.example.com/b



Version-Release number of selected component (if applicable):
4.10.0-0.nightly-2022-01-21-231627

How reproducible:
1/1

Steps to Reproduce:
1. Patch the cluster to use a dummy cincinnati
2. Upgrade the cluster by using "oc adm upgrade --to-latest --allow-not-recommended"
3.

Actual results:
oc adm upgrade --to-latest --allow-not-recommended updates the cluster to the latest one in recommended updates.

Expected results:
oc adm upgrade --to-latest --allow-not-recommended will update the cluster to the latest one among the recommended and conditional updates.

Or, if --allow-not-recommended is not applicable to –to-latest option, we need to indicate it in the help info 



Additional info:

Comment 1 W. Trevor King 2022-04-18 17:59:37 UTC
[1] should be fixing this.  If it turns out to do so, we can close this bug as a dup of bug 2075647.

[1]: https://github.com/openshift/oc/pull/1111/commits/27c7bdb46f4380d5cefb011c940eedb3294d3bad

Comment 2 Yang Yang 2022-04-20 11:59:24 UTC
Verifying with Client Version: 4.11.0-0.nightly-2022-04-20-045714

We have these updates:

# oc adm upgrade --include-not-recommended
Cluster version is 4.11.0-0.nightly-2022-04-16-163450

Upstream: https://raw.githubusercontent.com/shellyyang1989/upgrade-cincy/master/cincy-conditional-edge.json
Channel: stable-4.11

Recommended updates:

  VERSION                            IMAGE
  4.11.0-0.nightly-2022-04-19-195955 registry.ci.openshift.org/ocp/release@sha256:a5cd1b44e5b25b8a617d92a1f947297f56fc9bad104c117a8e452f932e1e2fd0

Supported but not recommended updates:

  Version: 4.11.0-0.nightly-2022-04-20-045714
  Image: registry.ci.openshift.org/ocp/release@sha256:e385a786f122c6c0e8848ecb9901f510676438f17af8a5c4c206807a9bc0bf28
  Recommended: False
  Reason: ReleaseIsRejected
  Message: Too many CI failures on this release, so do not update to it https://openshift-release.apps.ci.l2s4.p1.openshiftapps.com/releasestream/4.10.0-0.nightly/release/4.10.0-0.nightly-2021-11-24-075634

  Version: 4.11.0-0.nightly-2022-04-19-111252
  Image: registry.ci.openshift.org/ocp/release@sha256:66c753e8b75d172f2a3f7ba13363383a76ecbc7ecdc00f3a423bef4ea8560405
  Recommended: False
  Reason: SomeInvokerThing
  Message: On clusters on default invoker user, this imaginary bug can happen. https://bug.example.com/a

Upgrade to the latest conditional update:

# oc adm upgrade --to-latest --allow-not-recommended --force
warning: with --allow-not-recommended you have accepted the risks with 4.11.0-0.nightly-2022-04-20-045714 and bypassed Recommended=False ReleaseIsRejected: Too many CI failures on this release, so do not update to it https://openshift-release.apps.ci.l2s4.p1.openshiftapps.com/releasestream/4.10.0-0.nightly/release/4.10.0-0.nightly-2021-11-24-075634
warning: --force overrides cluster verification of your supplied release image and waives any update precondition failures.
Updating to 4.11.0-0.nightly-2022-04-20-045714

# oc get clusterversion
NAME      VERSION                              AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.11.0-0.nightly-2022-04-16-163450   True        True          119s    Working towards 4.11.0-0.nightly-2022-04-20-045714: 146 of 787 done (18% complete)


Looks good.