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
Bug 1878925: pkg/cli/admin/upgrade: Remove help text around history lookups #566
Bug 1878925: pkg/cli/admin/upgrade: Remove help text around history lookups #566
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: wking The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@wking: This pull request references Bugzilla bug 1878925, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
In 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. |
@wking: This pull request references Bugzilla bug 1878925, which is valid. 3 validation(s) were run on this bug
In 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. |
/assign @jottofar |
pkg/cli/admin/upgrade/upgrade.go
Outdated
if update == nil { | ||
if len(cv.Status.AvailableUpdates) == 0 { | ||
if c := findCondition(cv.Status.Conditions, configv1.RetrievedUpdates); c != nil && c.Status == configv1.ConditionFalse { | ||
return fmt.Errorf("Can't look up image for version %s. %v", o.To, c.Message) | ||
} | ||
return fmt.Errorf("No available updates, specify --to-image or wait for new updates to be available") | ||
} | ||
return fmt.Errorf("The update %s is not one of the available updates: %s", o.To, strings.Join(versionStrings(cv.Status.AvailableUpdates), ", ")) | ||
return fmt.Errorf("The update %s is neither one of the available updates (%s) nor a history entry", o.To, strings.Join(versionStrings(cv.Status.AvailableUpdates), ", ")) |
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.
Why can not we just say The %s is not available to update
? Do we really need to print the available update versions?
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.
I not comfortable in printing about nor a history entry
when we do not encourage customers to downgrade.
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.
Should we put this behind --allow-versions-from-history
or some such with a warning when it's needed, like our other --allow-...
handling?
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.
But is a version from history still necessarily available in channel for an 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.
Good point from both of you about having a guard around downgrades. I've pushed 2b92106 -> adb05a7 to wire this up to the existing --allow-explicit-upgrade
. If --to ...
picks a value from availableUpdates
, it doesn't matter whether you've set --allow-explicit-upgrade
or not. But with adb05a7, when --to ...
picks a value from the history, you will either fail to update (when --allow-explicit-upgrade
was not set) or successfully trigger the update but with a stderr complaint (when --allow-explicit-upgrade
was set). I think that addresses the safety concerns.
Do we really need to print the available update versions?
No, but mentioning them means folks can skip a separate oc adm upgrade
step that may return a different list of available updates than the set we just used to reject their choice.
I not comfortable in printing about
nor a history entry
...
Does the new --allow-explicit-upgrade
integration address your concerns there?
But is a version from history still necessarily available in channel for an update?
Nope. And the point of this PR is allowing these updates to previous versions without requiring either oc patch ...
or folks looking up the by-digest pullspec themselves. But yes, there is a safety issue with rolling the cluster back. Does the new --allow-explicit-upgrade
integration address your concerns there?
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.
@wking nor a history entry
, will the customer understand what this means? If yes then I am ok with this one.
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.
@wking nor a history entry , will the customer understand what this means?
Are you asking for a rephrase that says "you can draw from either set" without using "neither ... nor ..."? Or something that mentions the fact this history entries may not be recommended updates? Or...?
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.
Here is my suggestion The update %s is neither one of the available updates (%s) nor present in the update history
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.
2b92106
to
adb05a7
Compare
@wking: The following test failed, say
Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
/bugzilla refresh |
@stevekuznetsov: This pull request references Bugzilla bug 1878925, which is invalid:
Comment In 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. |
@wking: The following tests failed, say
Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
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 |
/bugzilla refresh |
@wking: This pull request references Bugzilla bug 1878925, which is invalid:
Comment In 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. |
/bugzilla refresh |
@wking: This pull request references Bugzilla bug 1878925, which is valid. 3 validation(s) were run on this bug
In 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. |
pkg/cli/admin/upgrade/upgrade.go
Outdated
if !o.AllowExplicitUpgrade { | ||
return fmt.Errorf("The requested upgrade image is not one of the available updates, you must pass --allow-explicit-upgrade to continue") | ||
} | ||
fmt.Fprintln(o.ErrOut, "warning: The requested upgrade version is not one of the available updates. You have used --allow-explicit-upgrade to the update to proceed anyway") |
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.
IMO we do not need You have used --allow-explicit-upgrade to the update to proceed anyway"
in the sentence.
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.
It matches the existing pattern I used in previous work which has already landed. If you would rather not point out why particular guard failures are being waved, can you submit a master PR to remove the existing instances?
pkg/cli/admin/upgrade/upgrade.go
Outdated
if update == nil { | ||
if len(cv.Status.AvailableUpdates) == 0 { | ||
if c := findCondition(cv.Status.Conditions, configv1.RetrievedUpdates); c != nil && c.Status == configv1.ConditionFalse { | ||
return fmt.Errorf("Can't look up image for version %s. %v", o.To, c.Message) | ||
} | ||
return fmt.Errorf("No available updates, specify --to-image or wait for new updates to be available") | ||
} | ||
return fmt.Errorf("The update %s is not one of the available updates: %s", o.To, strings.Join(versionStrings(cv.Status.AvailableUpdates), ", ")) | ||
return fmt.Errorf("The update %s is neither one of the available updates (%s) nor a history entry", o.To, strings.Join(versionStrings(cv.Status.AvailableUpdates), ", ")) |
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.
Here is my suggestion The update %s is neither one of the available updates (%s) nor present in the update history
Stale issues rot after 30d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle rotten |
/bugzilla refresh The requirements for Bugzilla bugs have changed, recalculating validity. |
@openshift-merge-robot: This pull request references Bugzilla bug 1878925, which is invalid:
Comment Retaining the bugzilla/valid-bug label as it was manually added. In 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. |
/bugzilla refresh The requirements for Bugzilla bugs have changed, recalculating validity. |
@openshift-merge-robot: This pull request references Bugzilla bug 1878925, which is invalid:
Comment Retaining the bugzilla/valid-bug label as it was manually added. In 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. |
Rotten issues close after 30d of inactivity. Reopen the issue by commenting /close |
@openshift-bot: Closed this PR. In 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. |
@wking: This pull request references Bugzilla bug 1878925. The bug has been updated to no longer refer to the pull request using the external bug tracker. All external bug links have been closed. The bug has been moved to the NEW state. In 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. |
/reopen |
@wking: Reopened this PR. In 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. |
@wking: This pull request references Bugzilla bug 1878925, which is invalid:
Comment Retaining the bugzilla/valid-bug label as it was manually added. In 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. |
We've had it at least since this repo was created in 3abf60a (setup oc repo, 2019-06-17), but the --to implementation has only ever iterated over availableUpdates. This catches the help text up with reality. The confused help text is likely because cluster-version operator does currently search history as well [1], but we're about to remove that too, to make it harder to ask for dangerous rollbacks. [1]: https://github.com/openshift/cluster-version-operator/blob/6d56c655ea16f6faee4b65ffef43dcd912657bc6/pkg/cvo/updatepayload.go#L305-L325
754657b
to
fcc58db
Compare
/bugzilla refresh |
@wking: This pull request references Bugzilla bug 1878925, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
Requesting review from QA contact: In 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. |
@wking: The following test failed, say
Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jottofar, wking The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@wking: All pull requests linked via external trackers have merged: Bugzilla bug 1878925 has been moved to the MODIFIED state. In 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. |
Copying from the CVO, and adjusting to return a pointer instead of a (non-pointer,found) tuple. Future work can shift this function into library-go. This avoids:
When that lookup would succeed when investigating ClusterVersion's
status.history
: