Skip to content

Conversation

@openshift-cherrypick-robot

This is an automated cherry-pick of #1111

/assign wking

wking added 3 commits April 21, 2022 05:04
…update targets

When folks use --to-image and --allow-explicit-upgrade together, oc
searches through recommended (and, with --allow-explicit-upgrade, also
supported but not recommended) targets to see if it knew about the
requested target image.

Until this commit, it would throw out that information, create an
Update that just pointed at the target release image, and warn the
user about the risks of --allow-explicit-upgrade.

With this commit, --allow-explicit-upgrade is consumed conditionally.
If we need it, because the earlier image search was unable to turn up
the requested release in ClusterVersion status, we'll still create an
Update and warn about the risks of --allow-explicit-upgrade.  But if
the search found the requested image (update != nil), we just use that
as if the user had requested it with --to, and we no longer pester the
user with complaints about the --allow-explicit-upgrade that they used
but, in this case, didn't need.
… together

6c8d935 (Adding the flag --allow-not-recommended to oc adm upgrade,
2021-12-01, openshift#986) taught --to and --to-image about
--allow-not-recommended.  This commit extends that coverage to
--to-latest, allowing folks to say "I want the latest supported
update, even if that update is not currently recommended".  Probably
not the best idea to do that sort of thing, but that's generally true
of --allow-not-recommended.

To accomplish this change, I've consolidated into a single "user
requested an update" case, where we use one of the three options
(--to-latest, --to, or --to-image) to hunt for a target update, and
then centralized logic to actually apply that target.
ClusterVersion's spec can evolve over time, growing additional
properties like capabilities [1].  With the old POST/Update(...)
approach, that could lead to older oc (who didn't know about the new
properties) naively clearing them when they washed the in-cluster
resource through their local ClusterVersion Go type.  With this
commit, we transition to PATCH, so we can touch just
spec.desiredUpdate, regardless of what else is going on in spec.

[1]: openshift/api@5b82635
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 21, 2022

@openshift-cherrypick-robot: Bugzilla bug 2075647 has been cloned as Bugzilla bug 2077332. Retitling PR to link against new bug.
/retitle [release-4.10] Bug 2077332: pkg/cli/admin/upgrade: Use PATCH instead of POST for spec updates

Details

In response to this:

[release-4.10] Bug 2075647: pkg/cli/admin/upgrade: Use PATCH instead of POST for spec updates

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.

@openshift-ci openshift-ci bot changed the title [release-4.10] Bug 2075647: pkg/cli/admin/upgrade: Use PATCH instead of POST for spec updates [release-4.10] Bug 2077332: pkg/cli/admin/upgrade: Use PATCH instead of POST for spec updates Apr 21, 2022
@openshift-ci openshift-ci bot added bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels Apr 21, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 21, 2022

@openshift-cherrypick-robot: This pull request references Bugzilla bug 2077332, 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.

6 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.10.z) matches configured target release for branch (4.10.z)
  • bug is in the state NEW, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)
  • dependent bug Bugzilla bug 2075647 is in the state VERIFIED, which is one of the valid states (VERIFIED, RELEASE_PENDING, CLOSED (ERRATA), CLOSED (CURRENTRELEASE))
  • dependent Bugzilla bug 2075647 targets the "4.11.0" release, which is one of the valid target releases: 4.11.0
  • bug has dependents

Requesting review from QA contact:
/cc @evakhoni

Details

In response to this:

[release-4.10] Bug 2077332: pkg/cli/admin/upgrade: Use PATCH instead of POST for spec updates

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
Copy link
Member

wking commented Apr 21, 2022

No need for [release-4.10], GitHub tracks that as structured info, and it's redundant in a 4.10.z change-log where folks already know they're looking at 4.10 bugs.

/retitle Bug 2077332: pkg/cli/admin/upgrade: Use PATCH instead of POST for spec updates

@openshift-ci openshift-ci bot changed the title [release-4.10] Bug 2077332: pkg/cli/admin/upgrade: Use PATCH instead of POST for spec updates Bug 2077332: pkg/cli/admin/upgrade: Use PATCH instead of POST for spec updates Apr 21, 2022
Copy link
Member

@wking wking left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Apr 21, 2022
@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

8 similar comments
@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 21, 2022

@openshift-cherrypick-robot: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-metal-ipi-ovn-ipv6 9b5825d link false /test e2e-metal-ipi-ovn-ipv6

Full PR test history. Your PR dashboard.

Details

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.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

5 similar comments
@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

Copy link
Contributor

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

/label backport-risk-assessed

@openshift-ci openshift-ci bot added the backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. label May 4, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented May 4, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: openshift-cherrypick-robot, soltysh, wking

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

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

13 similar comments
@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@kasturinarra
Copy link

/label cherry-pick-approved

@openshift-ci openshift-ci bot added the cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. label May 5, 2022
@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 04ad1b5 into openshift:release-4.10 May 5, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented May 5, 2022

@openshift-cherrypick-robot: All pull requests linked via external trackers have merged:

Bugzilla bug 2077332 has been moved to the MODIFIED state.

Details

In response to this:

Bug 2077332: pkg/cli/admin/upgrade: Use PATCH instead of POST for spec updates

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.

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. backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants