-
Notifications
You must be signed in to change notification settings - Fork 422
OTA-932: pkg/cli/admin/update: Rename "upgrade" to "update" and similar #1472
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@wking: This pull request references OTA-932 which is a valid jira issue. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
3b0292c to
d258461
Compare
|
Testing with a local build: $ go build ./cmd/oc
$ ./oc adm update # new status approach
Cluster version is 4.13.2
...
$ ./oc adm upgrade # old status approach, confirming a warning is logged
oc adm update is deprecated. Use 'oc adm update ...' instead
Cluster version is 4.13.2
...
$ ./oc adm update --allow-upgrade-with-warnings --to 4.99.99 # two command line flags also moved, and using them gets a warning logged, but isn't fatal (the non-existed release used for testing is what fails this call)
Flag --allow-upgrade-with-warnings has been deprecated, please use --allow-update-with-warnings instead
error: the update is not one of the possible targets: 4.13.3. specify --to-image to continue with the update.
$ ./oc adm upgrade --help | grep -1 upgrade # the deprecated options are hidden
Aliases:
update, upgrade
So that looks good to me :) |
d258461 to
2098a85
Compare
2098a85 to
7b95972
Compare
|
What's the motivation behind logging deprecation warnings? I mean really:
Exactly. Many tools (e.g. If we're never going to remove it, let's not nag users to change pointlessly. |
7b95972 to
003a50d
Compare
|
Confusingly, |
| kcmdutil.CheckErr(o.Complete(f, cmd, args)) | ||
| kcmdutil.CheckErr(o.Run()) | ||
| }, | ||
| Aliases: []string{"upgrade"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deleted my previous comment about the warning message about upgraded because I saw that we already printing the message.
The change from But I can live without the warning message as well, if you think strongly about it. |
LalatenduMohanty
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
I agree that the update is pointless as far as "does the invocation work" goes. But as I point out briefly in my initial post, there are ecosystem benefits to consistency. The more widespread the canonical phrasing is, the less mental overhead there is among folks sharing scripts, documenting behavior, and so on. The logged stderr messages will do a little bit to gradually shift existing call-sites over to the new canonical phrasing, and make it less likely that new callers chose the outdated format, and gradually the bulk of users will not even need to be aware that the outdated (but still functional) phrasing ever existed. |
pkg/cli/admin/update/update.go
Outdated
| `), | ||
| PersistentPreRunE: func(cmd *cobra.Command, args []string) error { | ||
| if cmd.CalledAs() != "update" { | ||
| fmt.Fprintf(o.ErrOut, "%s is deprecated. Use '%s ...' instead\n", cmd.CommandPath(), cmd.CommandPath()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❯ oc adm upgrade
oc adm update is deprecated. Use 'oc adm update ...' instead
..., cmd.CommandPath(), cmd.CommandPath()) seems wrong. we're using the same string twice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
/hold |
| use --force, which is passed through to ClusterVersion's spec.desiredUpdate.force. | ||
| `), | ||
| PersistentPreRunE: func(cmd *cobra.Command, args []string) error { | ||
| if cmd.CalledAs() != "update" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❯ oc adm update channel
oc adm update channel is deprecated. Use 'oc adm update channel ...' instead
info: Cluster channel is already clear (no change)
hmm.. we're not deprecating the channel subcommand right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Fixed in 003a50d -> 5f78beb:
$ ./oc adm upgrade channel
oc adm upgrade channel is deprecated. Use 'oc adm update channel ...' instead
error: You are requesting to clear the update channel. The current channel "candidate-4.13" is one of the available channels, you must pass --allow-explicit-channel to continueThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
retested - update channel still triggering a false positive!
❯ oc adm update channel
oc adm upgrade channel is deprecated. Use 'oc adm update channel ...' instead
info: Cluster channel is already clear (no change)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw, there's a double space in the middle - intentional?
003a50d to
e4079c1
Compare
|
New changes are detected. LGTM label has been removed. |
e4079c1 to
220d10e
Compare
The outgoing "upgrade" phrasing still works, but now logs deprecation warnings. We may never remove the outgoing "upgrade" phrasing, because it seems unlikely to be worth the compatibility churn. But moving the canonical phrasing to "update" aligns with openshift/openshift-docs@a68b607325 (Adding 'update' to the glossary, 2022-01-22, openshift/openshift-docs#40525). And logging the deprecation warnings makes the new canonical phrasing more obvious, which should help gradually transition existing consumers, because the more consistently folks use the canonical phrasing, the easier it is to find it with grep-searches when searching scripts and similar.
220d10e to
5f78beb
Compare
|
/retest |
|
I dropped my comments on Slack but wanted to write also in here; I'd highly suggest deprecating Instead we can deprecate and wait at least 1 releases for users to update their scripts to use new |
ardaguclu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
| Specify one or more images via pull spec to see details of each release image. You may also | ||
| pass a semantic version (4.11.2) as an argument, and if cluster version object has seen such a | ||
| version in the upgrades channel it will find the release info for that version. | ||
| version in the update channel it will find the release info for that version. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
| version in the update channel it will find the release info for that version. | |
| version in the updates channel it will find the release info for that version. |
|
I'd prefer to see the e2e-metal-ipi-ovn-ipv6 is also green. But since it is not required job; |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ardaguclu, LalatenduMohanty, wking The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@wking: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
|
/hold Will leave a note on the card as well. |
|
Issues go stale after 90d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle stale |
|
PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
We are not planning to rename upgrade to update. Rather we would re-imagine a new user experience for update sub-command, hence closing this PR |
|
/close |
|
@LalatenduMohanty: Closed this PR. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
The outgoing
upgradephrasing still works, but now logs deprecation warnings. We may never remove the outgoingupgradephrasing, because it seems unlikely to be worth the compatibility churn. But moving the canonical phrasing toupdatealigns with openshift/openshift-docs@a68b607325 (openshift/openshift-docs#40525). And logging the deprecation warnings makes the new canonical phrasing more obvious, which should help gradually transition existing consumers, because the more consistently folks use the canonical phrasing, the easier it is to find it with grep-searches when searching scripts and similar.