-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Avoid checking the VS and VSC status in the backup finalizing phase. #9092
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
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9092 +/- ##
==========================================
+ Coverage 59.04% 59.07% +0.02%
==========================================
Files 379 379
Lines 43509 43511 +2
==========================================
+ Hits 25690 25702 +12
+ Misses 16290 16281 -9
+ Partials 1529 1528 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thanks for this optimization! The refactoring to avoid unnecessary VSC lookups during the finalizing phase makes sense and improves efficiency. I noticed the patch coverage is currently at 50%, with the new finalizing phase logic in Would it be possible to add test cases for the new code path? Something like: // Add to TestVSExecute in volumesnapshot_action_test.go
{
name: "Backup in finalizing phase - skip VSC lookup",
backup: builder.ForBackup("velero", "backup").
Phase(velerov1api.BackupPhaseFinalizing).Result(),
vs: builder.ForVolumeSnapshot("velero", "vs").
ObjectMeta(builder.WithLabels(
velerov1api.BackupNameLabel, "backup")).
Status().
BoundVolumeSnapshotContentName("vsc").Result(),
vsc: nil, // VSC won't be created/fetched
expectedErr: "",
expectedAdditionalItems: nil,
expectedItemToUpdate: nil,
},
{
name: "Backup in finalizing partially failed phase - skip VSC lookup",
backup: builder.ForBackup("velero", "backup").
Phase(velerov1api.BackupPhaseFinalizingPartiallyFailed).Result(),
vs: builder.ForVolumeSnapshot("velero", "vs").
ObjectMeta(builder.WithLabels(
velerov1api.BackupNameLabel, "backup")).
Status().
BoundVolumeSnapshotContentName("vsc").Result(),
vsc: nil, // VSC won't be created/fetched
expectedErr: "",
expectedAdditionalItems: nil,
expectedItemToUpdate: nil,
},This would verify the early return path and ensure |
|
@kaovilai |
Signed-off-by: Xun Jiang <[email protected]>
Thank you for contributing to Velero!
Please add a summary of your change
Does your change fix a particular issue?
Fixes #(issue)
Please indicate you've done the following:
make new-changelog) or comment/kind changelog-not-requiredon this PR.site/content/docs/main.