Fix ListBackups to skip directories without metadata file#9511
Fix ListBackups to skip directories without metadata file#9511mpryc wants to merge 1 commit intovmware-tanzu:mainfrom
Conversation
dd2d4c1 to
2dfff8b
Compare
When using object stores with suspended versioning (e.g., MinIO), deleted backup folders persist as empty directories. The S3 API returns these directories, but they lack the velero-backup.json metadata file. This change adds a check in ListBackups() to verify that the backup metadata file exists before including a backup in the results. Empty directories without metadata are now logged at debug level and skipped. Fixes: vmware-tanzu#8466 Suggested-by: chrisamti <https://github.com/chrisamti> Signed-off-by: Michal Pryc <mpryc@redhat.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9511 +/- ##
=======================================
Coverage ? 60.53%
=======================================
Files ? 386
Lines ? 36378
Branches ? 0
=======================================
Hits ? 22023
Misses ? 12773
Partials ? 1582 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
From the issue's description, I think Velero can read the I'm still checking with the issue reporter to make sure that. If that is true, then the current fix cannot address the original issue. |
When using object stores with suspended versioning (e.g., MinIO), deleted backup folders persist as empty directories. The S3 API returns these directories, but they lack the velero-backup.json metadata file.
This change adds a check in ListBackups() to verify that the backup metadata file exists before including a backup in the results. Empty directories without metadata are now logged at debug level and skipped.
Suggested-by: @chrisamti
Fixes #8466
Please indicate you've done the following:
make new-changelog) or comment/kind changelog-not-requiredon this PR.