From 42944e9be912b69fd4c92329daf66ac082f19244 Mon Sep 17 00:00:00 2001 From: Shubham Pampattiwar Date: Fri, 25 Oct 2024 13:08:01 -0700 Subject: [PATCH] Fix OADP-5111: Backups partially fails when backing up all namespaces (#355) --- pkg/backup/backup.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/backup/backup.go b/pkg/backup/backup.go index dab850cf2f..3f15725891 100644 --- a/pkg/backup/backup.go +++ b/pkg/backup/backup.go @@ -739,6 +739,11 @@ func getNamespacesManagedByArgoCD(kbClient kbclient.Client, includedNamespaces [ for _, nsName := range includedNamespaces { ns := corev1api.Namespace{} if err := kbClient.Get(context.Background(), kbclient.ObjectKey{Name: nsName}, &ns); err != nil { + // check for only those ns that exist and are included in backup + // here we ignore cases like "" or "*" specified under includedNamespaces + if apierrors.IsNotFound(err) { + continue + } log.WithError(err).Errorf("error getting namespace %s", nsName) continue }