Skip to content

Commit

Permalink
restore: Use warning when Create IsAlreadyExist and Get error
Browse files Browse the repository at this point in the history
Signed-off-by: Tiger Kaovilai <[email protected]>
  • Loading branch information
kaovilai committed Oct 23, 2023
1 parent 107c558 commit 4295eec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions pkg/restore/7004-kaovilai
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
restore: Use warning when Create IsAlreadyExist and Get error
4 changes: 2 additions & 2 deletions pkg/restore/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Check warning on line 1538 in pkg/restore/restore.go

View check run for this annotation

Codecov / codecov/patch

pkg/restore/restore.go#L1537-L1538

Added lines #L1537 - L1538 were not covered by tests
return warnings, errs, itemExists
}
}
Expand Down

0 comments on commit 4295eec

Please sign in to comment.