-
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
LabelSelector should not be added while restoring pvc #11899
base: main
Are you sure you want to change the base?
Conversation
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. 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. |
Hi @muxuelanKK. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. 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. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
44bc372
to
817c3ad
Compare
/test all |
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.
Thanks for the PR!
I think the labelselector is just one symptom of a broader issue where we just copy out the entire spec of the source PVC.
Maybe we should take look at only setting fields we care about instead of
kubevirt/pkg/storage/snapshot/restore.go
Line 998 in 817c3ad
Spec: sourcePVC.Spec, |
@muxuelanKK is this affecting the restore at all? Curious if/how PV label selectors could have any effect when creating a PVC with VolumeSnapshot datasource @akalenyu I think this is the only field that could potentially be problematic. What do you think? |
This kubevirt/pkg/storage/snapshot/restore.go Line 1041 in 817c3ad
Maybe we could just set them all explicitly without copying, that would be nicer IMO |
Yes, hold on |
Signed-off-by: muxuelan <muxuelan@cmss.chinamobile.com>
done |
/lgtm |
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.
one note - may want to add a test in pkg/storage/snapshot/restore_test.go
to make sure we don't regress over this in the future
Resources: sourcePVC.Spec.Resources, | ||
StorageClassName: sourcePVC.Spec.StorageClassName, | ||
VolumeMode: sourcePVC.Spec.VolumeMode, | ||
}, |
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.
Given this new pattern of explicitly setting the fields we care about I think it makes sense to set dataSource and dataSourceRef in in this block 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.
@muxuelanKK you planning to come back to this?
When old pvc had pv selector, new pvc should not include it.