Bug 1826533 - 'oc adm upgrade' does not warn when dangerous options are used
Summary: 'oc adm upgrade' does not warn when dangerous options are used
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 4.1.z
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: 4.5.0
Assignee: W. Trevor King
QA Contact: zhou ying
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-04-21 22:05 UTC by W. Trevor King
Modified: 2020-07-13 17:30 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-07-13 17:29:58 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift oc pull 387 0 None closed Bug 1826533: pkg/cli/admin/upgrade: Warn when --force is used 2020-06-23 10:14:37 UTC
Github openshift oc pull 388 0 None closed Bug 1826533: pkg/cli/admin/upgrade: Warn when --allow-explicit-upgrade let you through 2020-06-23 10:14:37 UTC
Github openshift oc pull 389 0 None closed Bug 1826533: pkg/cli/admin/upgrade: Warn when --allow-upgrade-with-warnings let you through 2020-06-23 10:14:37 UTC
Github openshift oc pull 390 0 None closed Bug 1826533: pkg/cli/admin/upgrade: Client-side by-tag guard 2020-06-23 10:14:37 UTC
Red Hat Product Errata RHBA-2020:2409 0 None None None 2020-07-13 17:30:15 UTC

Description W. Trevor King 2020-04-21 22:05:10 UTC
'oc adm upgrade' has reasonable help text around dangerous options like --force, but there is no guarantee that users read the help text.  We should warn on stderr when something dangerous happens to raise awareness to help drive users towards safer workflows.

Comment 3 zhou ying 2020-05-12 03:24:53 UTC
[root@localhost ~]# oc version -o yaml 
clientVersion:
  buildDate: "2020-05-07T22:03:52Z"
  compiler: gc
  gitCommit: f415627b3a8df305c4dd0ada0b4bc1271846a777
  gitTreeState: clean
  gitVersion: 4.5.0-202005072157-f415627
  goVersion: go1.13.4
  major: ""
  minor: ""
  platform: linux/amd64


[root@localhost ~]# oc adm upgrade --to=4.4.0-0.ci-2020-05-07-213751 --force
warning: --force overrides cluster verification of your supplied release image and waives any update precondition failures.
error: already upgrading.

  Reason: ImageVerificationFailed
  Message: Unable to apply 4.4.0-0.ci-2020-05-07-005844: the image may not be safe to use



If you want to upgrade anyway, use --allow-upgrade-with-warnings.

Comment 4 W. Trevor King 2020-05-17 04:28:28 UTC
Does not need a doc update.  Folks who might see these stderr warnings will see them on stderr.  We don't need to call out the change in release notes too.

Comment 5 errata-xmlrpc 2020-07-13 17:29:58 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-2020:2409


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