Skip to content

Move pvc annotation removal from CSI RIA to regular PVC RIA #8755

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

Merged
merged 1 commit into from
Mar 11, 2025

Conversation

sseago
Copy link
Collaborator

@sseago sseago commented Mar 5, 2025

Combine existing PVC non-CSI RIAs and move annotation removal out of the CSI plugin to fix issues with
CSI volumes when using fs-backup

Thank you for contributing to Velero!

Please add a summary of your change

The CSI RIA plugin removed several annotations on restore. Because the CSI plugin exits early without action when not restoring via CSI snapshot or datamover, these annotations were not removed when CSI volumes were restored via fs-backup. For the linked issue, this meant that restoring to a cluster with a different CSI driver would fail when using fs-backup. These annotations should always be removed, not just when using CSI snapshots, so this code needed to be moved to a regular RIA that runs in all cases.

There were already two non-CSI RIA plugins for PVCs. Rather than create a third one, this PR combines those into one, to avoid needing 3 different grpc calls -- the CSI plugin remains separate.

Because the non-CSI plugin already handled selected node in a more targeted way (already documented process for explicit node change via configmap, and if there is no configmap and the selected node does not exist in restore cluster, then the annotation is removed), the migrated annotation removal functionality no longer applies to the selected node, so now the behavior will match documented behavior in all cases.

Does your change fix a particular issue?

Fixes #8731

Please indicate you've done the following:

Combine existing PVC non-CSI RIAs and move annotation
removal out of the CSI plugin to fix issues with
CSI volumes when using fs-backup

Signed-off-by: Scott Seago <[email protected]>
@sseago sseago force-pushed the csi-pvc-annotations branch from 419759e to fe14a2c Compare March 5, 2025 20:58
Copy link

codecov bot commented Mar 5, 2025

Codecov Report

Attention: Patch coverage is 73.60000% with 33 lines in your changes missing coverage. Please review.

Project coverage is 59.54%. Comparing base (3821906) to head (fe14a2c).
Report is 26 commits behind head on main.

Files with missing lines Patch % Lines
pkg/restore/actions/pvc_action.go 76.03% 21 Missing and 8 partials ⚠️
pkg/cmd/server/plugin/plugin.go 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8755      +/-   ##
==========================================
+ Coverage   59.53%   59.54%   +0.01%     
==========================================
  Files         371      370       -1     
  Lines       40196    40168      -28     
==========================================
- Hits        23932    23920      -12     
+ Misses      14767    14752      -15     
+ Partials     1497     1496       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Could perhaps add a comment in this file that more generic actions to make PVC restore successful are in ../pvc_action.go

@shubham-pampattiwar shubham-pampattiwar merged commit 6337c52 into vmware-tanzu:main Mar 11, 2025
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PVC annotations prevent restore when CSI driver is different on destination Cluster
4 participants