Skip to content
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

Enable DV status subresource #2611

Merged
merged 1 commit into from
Mar 8, 2023

Conversation

arnongilboa
Copy link
Collaborator

@arnongilboa arnongilboa commented Feb 28, 2023

What this PR does / why we need it:
DataVolume.Status can now be updated only by UpdateStatus() and no more by Update(), so regular users cannot update Status without special permission. In addition, updating just the Status would not update the Generation of the object, so we’ll have less object has been modified errors in the reconcile loops.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

Release note:

Enable DataVolume status subresource

@kubevirt-bot kubevirt-bot added dco-signoff: yes Indicates the PR's author has DCO signed all their commits. release-note-none Denotes a PR that doesn't merit a release note. size/L labels Feb 28, 2023
@arnongilboa arnongilboa force-pushed the dv_status_subresource branch 3 times, most recently from 2c8ce43 to b6b2774 Compare March 1, 2023 13:30
@kubevirt-bot kubevirt-bot added size/S and removed size/L labels Mar 1, 2023
Copy link
Member

@awels awels left a comment

Choose a reason for hiding this comment

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

looks good to me, just one minor comment.

@@ -825,7 +823,7 @@ func (r *ReconcilerBase) emitEvent(dataVolume *cdiv1.DataVolume, dataVolumeCopy
}
// Only update the object if something actually changed in the status.
if !reflect.DeepEqual(dataVolume.Status, dataVolumeCopy.Status) {
if err := r.updateDataVolume(dataVolumeCopy); err != nil {
if err := r.updateDataVolumeStatus(dataVolumeCopy); err != nil {
r.log.Error(err, "Unable to update datavolume", "name", dataVolumeCopy.Name)
Copy link
Member

Choose a reason for hiding this comment

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

Maybe change the error to unable to update datavolume status ?

@arnongilboa arnongilboa force-pushed the dv_status_subresource branch 2 times, most recently from e63d11e to 17d44f0 Compare March 2, 2023 11:26
DV status can now be updated only by UpdateStatus() and no more by
Update(), so regular users cannot update status without special
permission. In addition, updating just the status would not update
the generation of the object, so we’ll have less “object has been
modified” errors in the reconcile loops.

Signed-off-by: Arnon Gilboa <agilboa@redhat.com>
@kubevirt-bot kubevirt-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Mar 2, 2023
Copy link
Contributor

@ShellyKa13 ShellyKa13 left a comment

Choose a reason for hiding this comment

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

nice!
/lgtm

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Mar 2, 2023
Copy link
Collaborator

@akalenyu akalenyu left a comment

Choose a reason for hiding this comment

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

/lgtm

@mhenriks
Copy link
Member

mhenriks commented Mar 8, 2023

/approve

Now let's do this with our other CRDs!

@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mhenriks

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 8, 2023
@kubevirt-bot kubevirt-bot merged commit 90dce53 into kubevirt:main Mar 8, 2023
@arnongilboa
Copy link
Collaborator Author

/cherrypick release-v1.56

@kubevirt-bot
Copy link
Contributor

@arnongilboa: new pull request created: #2626

In response to this:

/cherrypick release-v1.56

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. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants