diff --git a/pkg/backup/item_collector.go b/pkg/backup/item_collector.go index 5cbc178361f..635e986dd9d 100644 --- a/pkg/backup/item_collector.go +++ b/pkg/backup/item_collector.go @@ -226,7 +226,7 @@ func (r *itemCollector) getResourceItems(log logrus.FieldLogger, gv schema.Group namespacesToList := getNamespacesToList(r.backupRequest.NamespaceIncludesExcludes) // Check if we're backing up namespaces, and only certain ones - if gr == kuberesource.Namespaces && namespacesToList[0] != "" { + if gr == kuberesource.Namespaces && (len(namespacesToList)== 0 || namespacesToList[0] != "") { resourceClient, err := r.dynamicFactory.ClientForGroupVersionResource(gv, resource, "") if err != nil { log.WithError(err).Error("Error getting dynamic client")