diff --git a/changelogs/unreleased/7055-kaovilai b/changelogs/unreleased/7055-kaovilai new file mode 100644 index 0000000000..5ee6a0e17f --- /dev/null +++ b/changelogs/unreleased/7055-kaovilai @@ -0,0 +1 @@ +restore: Use warning when Create IsAlreadyExist and Get error diff --git a/pkg/restore/restore.go b/pkg/restore/restore.go index e163c2e9a9..ee9997bebe 100644 --- a/pkg/restore/restore.go +++ b/pkg/restore/restore.go @@ -1357,8 +1357,8 @@ func (ctx *restoreContext) restoreItem(obj *unstructured.Unstructured, groupReso // otherwise, we will return the original creation error. 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 be restored by velero or have restore labels, and existing resource policy is not applied", kube.NamespaceAndName(obj), err) + warnings.Add(namespace, err) return warnings, errs, itemExists } }