-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Restart required correctly propagate #11836
Restart required correctly propagate #11836
Conversation
Skipping CI for Draft Pull Request. |
Removing the `DeepCopy` from updateStatus allow us to detect changes to the Status inside the "sync" and acaccurately represent changes. Signed-off-by: Luboslav Pivarc <lpivarc@redhat.com>
VM CRD has a status subresource enabled. This means that "Update" ignores changes to the status stanza. Also propagate status changes from "hotplug sync" by returning the cloned vm. Signed-off-by: Luboslav Pivarc <lpivarc@redhat.com>
f53d55e
to
71de121
Compare
} else { | ||
vm = vmCopy |
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.
That means that if spec/objectmeta changed, we ignore status changes, right?
Example: something above changed both vm.spec and vm.status. We'll call update, which will lose the status changes, and return updatedVm instead of vmCopy.
How about something like that instead?
} else { | |
vm = vmCopy | |
} | |
vm.Status = *vmCopy.Status.DeepCopy() |
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.
That means that if spec/objectmeta changed, we ignore status changes, right?
Yes, there are couple of edge cases that are not fixed by this PR but the last 3 PRs are making it much more simple to fix these cases. @acardace should have a PR that will fix at least partially these cases.
Example: something above changed both vm.spec and vm.status. We'll call update, which will lose the status changes, and return updatedVm instead of vmCopy.
How about something like that instead?
WDYT about adding equality.Semantic.DeepEqual(vm.Status, vmCopy.Status) && (!equality.Semantic.DeepEqual(vm.Spec, vmCopy.Spec) || !equality.Semantic.DeepEqual(vm.ObjectMeta, vmCopy.ObjectMeta)) {
? But as I said this should be fixed as follow up.
The vm.Status = *vmCopy.Status
should not be needed because if the status have changed then no spec changes should be done as well...
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.
The
vm.Status = *vmCopy.Status
should not be needed because if the status have changed then no spec changes should be done as well...
If we know we never change both Status and Spec at the same time, then this is all good!
/approve
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.
We do unfortunately but that is bug on its own but the PR doesn't make it worse
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jean-edouard 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 |
/cc @fossedihelm |
/cherry-pick release-1.2 |
@xpivarc: once the present PR merges, I will cherry-pick it on top of release-1.2 in a new PR and assign it to you. 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-sigs/prow repository. |
Required labels detected, running phase 2 presubmits: |
/retest-required |
/retest-required |
2 similar comments
/retest-required |
/retest-required |
/hold |
@xpivarc: The following test failed, say
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. |
PR needs rebase. 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. |
Close in favor of |
What this PR does
This PR fixes cases where RestartRequired condition is not propagated to Kubernetes API. The cause is
Update
call that should not be called when only.Status
is changed (note if a change was made the condition will be missing). Also ensure that we detect a.Status
change in theupdateStatus
.Fixes #
Special notes for your reviewer
Release note
Based on #11726