mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-07-26 01:53:09 +00:00
When getNamespacesToList returns "" (cross-namespace listing), resources from all namespaces are listed. The nsTracker.track call for each resource's namespace would inadvertently track excluded namespaces, causing their namespace objects to pass through filterNamespaces. Add a ShouldInclude check before tracking a namespace from non-namespace resources to ensure excluded namespaces are not tracked. Add test case for includedNamespaces ["*"] with excludedNamespaces to verify both the namespace object exclusion and resource exclusion. Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>