From 4295eec750c365716d9c404ab11e4fbd6d0746d5 Mon Sep 17 00:00:00 2001 From: Tiger Kaovilai Date: Mon, 23 Oct 2023 13:29:17 -0400 Subject: [PATCH] restore: Use warning when Create IsAlreadyExist and Get error Signed-off-by: Tiger Kaovilai --- pkg/restore/7004-kaovilai | 1 + pkg/restore/restore.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 pkg/restore/7004-kaovilai diff --git a/pkg/restore/7004-kaovilai b/pkg/restore/7004-kaovilai new file mode 100644 index 0000000000..3b85df1962 --- /dev/null +++ b/pkg/restore/7004-kaovilai @@ -0,0 +1 @@ +restore: Use warning when Create IsAlreadyExist and Get error \ No newline at end of file diff --git a/pkg/restore/restore.go b/pkg/restore/restore.go index 8355533300..be95ede3e4 100644 --- a/pkg/restore/restore.go +++ b/pkg/restore/restore.go @@ -1534,8 +1534,8 @@ func (ctx *restoreContext) restoreItem(obj *unstructured.Unstructured, groupReso fromCluster, err = resourceClient.Get(name, metav1.GetOptions{}) } if err != nil && isAlreadyExistsError { - ctx.log.Errorf("Error retrieving in-cluster version of %s: %v", kube.NamespaceAndName(obj), err) - errs.Add(namespace, err) + ctx.log.Warnf("Unable to retrieve in-cluster version of %s: %v, object won't have restore labels", kube.NamespaceAndName(obj), err) + warnings.Add(namespace, err) return warnings, errs, itemExists } }