Skip to content

Add oc adm upgrade prototype command#21605

Merged
openshift-merge-robot merged 2 commits intoopenshift:masterfrom
smarterclayton:load_from_cluster
Dec 5, 2018
Merged

Add oc adm upgrade prototype command#21605
openshift-merge-robot merged 2 commits intoopenshift:masterfrom
smarterclayton:load_from_cluster

Conversation

@smarterclayton
Copy link
Copy Markdown
Contributor

@smarterclayton smarterclayton commented Dec 4, 2018

Also allow retrieving the current release info when connected to a 4.0 cluster.

$ oc adm release info
// fetches current cluster payload

$ oc adm upgrade
info: An upgrade is in progress. Working towards registry.svc.ci.openshift.org/openshift/origin-release:4.0.0-0.alpha-2018-12-04-203442

warning: Cannot display available updates:
  Reason: RemoteFailed
  Message: Unable to retrieve available updates: unexpected HTTP status: 404 Not Found

$ oc adm upgrade --to-image=4.0.0-anoehtu
error: --to-image must be a valid image pull spec: no registry or repository specified

$ oc adm upgrade --to-image=registry.svc.ci.openshift.org/openshift/origin-release:4.0.0-0.alpha-2018-12-04-203442
Updating to release image registry.svc.ci.openshift.org/openshift/origin-release:4.0.0-0.alpha-2018-12-04-203442

If `oc adm release info` is provided without arguments and the
user is connected to a 4.0 cluster, attempt to locate the current
release image and show those details to the user.
@openshift-ci-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 4, 2018
@smarterclayton
Copy link
Copy Markdown
Contributor Author

@derekwaynecarr @crawford @abhinavdahiya @spadgett

This is just the sketch for the upgrade command, some of the changes in
openshift/cluster-version-operator#63 make this a more complete experience and easier to write but aren't necessary for the basic example.

You can also run oc adm release info against a cluster and get the current version.

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 4, 2018
@smarterclayton smarterclayton force-pushed the load_from_cluster branch 3 times, most recently from bd433b6 to 9856b73 Compare December 4, 2018 23:38
@openshift-ci-robot openshift-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 4, 2018
@openshift-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: smarterclayton

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@smarterclayton smarterclayton added the lgtm Indicates that a PR is ready to be merged. label Dec 4, 2018
This command will update the cluster version object on a 4.0 or newer
cluster and provide information about available versions. It uses the
status provided by the cluster version operator on the object to inform
the user of any errors or upgrades in progress.
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Dec 5, 2018
@openshift-ci-robot
Copy link
Copy Markdown

New changes are detected. LGTM label has been removed.

@smarterclayton smarterclayton added the lgtm Indicates that a PR is ready to be merged. label Dec 5, 2018
@smarterclayton
Copy link
Copy Markdown
Contributor Author

/retest

@openshift-merge-robot openshift-merge-robot merged commit 5428c61 into openshift:master Dec 5, 2018
}
args = []string{image}
}
if len(args) < 1 {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer when we fail fast, I still remember you've been picky about it in one of my early PRs.

wking added a commit to wking/oc that referenced this pull request Aug 16, 2021
…uster upgrades"

The previous:

  This command will request that the cluster begin an upgrade...

and similar confused some readers [1], because the no-argument
invocation is just a read query that does not request an update.  This
commit makes the wording more generic, to match the subcommand's
actual generic functionality (reading from and optionally writing to
ClusterVersion).

I've also tweaked the "No updates available" message to avoid folks
misreading as:

  ... doing so may not... result in downtime or data loss.

when we are trying to convey that updating despite a lack of
recommendations might be dangerous.

In both cases, the wording I'm altering dates back to the creation of
this subcommand in cd30f2f (Add `oc adm upgrade` to display
available updates or trigger an update, 2018-12-04,
openshift/origin#21605).

[1]: https://bugzilla.redhat.com/show_bug.cgi?id=1992680#c2
wking added a commit to wking/oc that referenced this pull request Nov 21, 2022
The outgoing wording dates back to the initial subcommand
implementation in openshift/origin@65cce8c37d (Add `oc adm upgrade` to
display available updates or trigger an update, 2018-12-04,
openshift/origin#21605).  But "force" is easy to conflate with the
--force option, and we occasionally hear of users who set --force
under the mistaken impression that it is related to the
recommended-ness of the target release image.  There's already a
paragraph in the generic --help text discussing the risks of
--allow-explicit-upgrade, and folks who use --to-image in the absence
of recommended updates will hear about --allow-explicit-upgrade when a
bare --to-image fails to turn up the requested pullspec in
availableUpdates.
wking added a commit to wking/oc that referenced this pull request Nov 21, 2022
The outgoing wording dates back to the initial subcommand
implementation in openshift/origin@65cce8c37d (Add `oc adm upgrade` to
display available updates or trigger an update, 2018-12-04,
openshift/origin#21605).  But "force" is easy to conflate with the
--force option, and we occasionally hear of users who set --force
under the mistaken impression that it is related to the
recommended-ness of the target release image.

This message is only rendered when availableUpdates is empty, so
--to-image is unlikely to be sufficient.  The current output will be:

  $ oc adm upgrade --to-image quay.io/openshift-release-dev/ocp-release@sha256:20e270c3349fe2fcb38fd0da155329babc02d6b53e7e06ff235346c3c1cf11b5
  error: no recommended updates, specify --allow-explicit-upgrade to continue with the update or wait for new updates to be available.

which we could stiffen up by including some of --help's current
warnings about --allow-explicit-upgrade risk, but we can address that
in follow-up work.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants