mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-07-26 01:53:09 +00:00
Commit8ac8f49b5("Remove wildcard check from getNamespacesToList") removed the optimization that prevented "*" from being expanded to individual namespace names. This caused getNamespacesToList to return all namespace names instead of "" (cross-namespace listing), resulting in N separate API list calls per resource type instead of 1. On clusters with many namespaces (e.g. 178 on an ACM cluster), this means ~35,000 API calls instead of ~200, causing backups to take 18-20 minutes for just 8 items. Restore the "*" special case in ShouldExpandWildcards so that plain "*" is not expanded, and restore the ShouldInclude("*") check in getNamespacesToList so that cross-namespace listing is used. The restore fix from8ac8f49b5(fromBackup flag) is preserved since restores already return false before reaching the "*" check. Namespace exclusion continues to work correctly: the nsTracker filters excluded namespace objects via ShouldInclude, and backupItem filters namespace-scoped resources at line 124 of item_backupper.go. Fixes #9869 Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>