OCPBUGS-44328: Fix desired before sync_worker's work is initialized - #1104
Conversation
If the CVO pod gets restarted after a user sends a cluster upgrade request with `--to-image`, the desired should not ALWAYS be taken from `.Spec.DesiredUpdate`, e.g., when the targeting payload is blocked on some precondition check failure. The user request will be written to `cv.spec.desiredUpdate` where only the `image` field is set, i.e., the `Version` field is empty. If the CVO gets restarted, then 1. The desied [1] from `cv.spec.desiredUpdate` will be used to set `w.status.Actual` [2] and then applied to `cv.status.desired`. 2. When the next `optr.sync()` happens, the precondition check may become non-blocking [3] as the `Version` field is empty now. 3. CVO will then start an upgrade that should have been blocked. [1]. https://github.com/openshift/cluster-version-operator/blob/1995380b6d755c29b926b846a64ca0039002c2cf/pkg/cvo/cvo.go#L680 [2]. https://github.com/openshift/cluster-version-operator/blob/1995380b6d755c29b926b846a64ca0039002c2cf/pkg/cvo/sync_worker.go#L502 [3]. https://github.com/openshift/cluster-version-operator/blob/1995380b6d755c29b926b846a64ca0039002c2cf/pkg/payload/precondition/clusterversion/rollback.go#L57
|
/test-required |
|
/test unit |
|
/retest-required |
|
@hongkailiu: all tests passed! 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-sigs/prow repository. I understand the commands that are listed here. |
|
/jira cherrypick OCPBUGS-43964 |
|
@hongkailiu: Jira Issue OCPBUGS-43964 has been cloned as Jira Issue OCPBUGS-44328. Will retitle bug to link to clone. 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 openshift-eng/jira-lifecycle-plugin repository. |
|
@hongkailiu: This pull request references Jira Issue OCPBUGS-44328, which is valid. The bug has been moved to the POST state. 7 validation(s) were run on this bug
Requesting review from QA contact: The bug has been updated to refer to the pull request using the external bug tracker. 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 openshift-eng/jira-lifecycle-plugin repository. |
|
/jira refresh |
|
@hongkailiu: This pull request references Jira Issue OCPBUGS-44328, which is valid. 7 validation(s) were run on this bug
Requesting review from QA contact: The bug has been updated to refer to the pull request using the external bug tracker. 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 openshift-eng/jira-lifecycle-plugin repository. |
|
/retitle OCPBUGS-44328: Fix desired before sync_worker's work is initialized |
wking
left a comment
There was a problem hiding this comment.
/lgtm
/label backport-risk-assessed
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hongkailiu, 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 |
|
so the only change outside of the unit test, is the |
Correct and correct. |
|
ok then, verified. |
|
@hongkailiu: This pull request references Jira Issue OCPBUGS-44328, which is valid. 7 validation(s) were run on this bug
Requesting review from QA contact: The bug has been updated to refer to the pull request using the external bug tracker. 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 openshift-eng/jira-lifecycle-plugin repository. |
|
/cherrypick release-4.14 |
|
@hongkailiu: once the present PR merges, I will cherry-pick it on top of 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-sigs/prow repository. |
|
/label cherry-pick-approved |
|
@hongkailiu: Jira Issue OCPBUGS-44328: All pull requests linked via external trackers have merged: Jira Issue OCPBUGS-44328 has been moved to the MODIFIED state. 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 openshift-eng/jira-lifecycle-plugin repository. |
|
@hongkailiu: new pull request created: #1109 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-sigs/prow repository. |
|
[ART PR BUILD NOTIFIER] Distgit: cluster-version-operator |
|
Fix included in accepted release 4.15.0-0.nightly-2024-11-19-015320 |
This PR is generated by
and then fix the backported unit test
TestCVO_UpgradePayloadStillInitializingby the following editting:where
alwaysEnableCapabilitiesis removed because it is not used in 4.15 and the variablessortedCapsandsortedKnownCapsare added because they are used in the backported unit test.Note that e94580f is not picked to keep the manual work simple. Otherwise it would lead to more manual work such as fixing using constants from the new API like
configv1.ClusterVersionCapabilityIngresswhich is not available for 4.15.