Skip to content

Commit

Permalink
Merge branch 'vmware-tanzu:release-1.10' into release-1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
blackpiglet authored Apr 13, 2023
2 parents de3d308 + ba6e356 commit 4396be6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions changelogs/unreleased/6086-Lyndon-Li
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix issue #5972, don't assume errorField as error type when dealing with logger.WithError
1 change: 1 addition & 0 deletions changelogs/unreleased/6135-ywk253100
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Ignore not found error during patching managedFields
9 changes: 6 additions & 3 deletions pkg/restore/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -1434,10 +1434,13 @@ func (ctx *restoreContext) restoreItem(obj *unstructured.Unstructured, groupReso
if patchBytes != nil {
if _, err = resourceClient.Patch(name, patchBytes); err != nil {
ctx.log.Errorf("error patch for managed fields %s: %v", kube.NamespaceAndName(obj), err)
errs.Add(namespace, err)
return warnings, errs
if !apierrors.IsNotFound(err) {
errs.Add(namespace, err)
return warnings, errs
}
} else {
ctx.log.Infof("the managed fields for %s is patched", kube.NamespaceAndName(obj))
}
ctx.log.Infof("the managed fields for %s is patched", kube.NamespaceAndName(obj))
}

if groupResource == kuberesource.Pods {
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/logging/log_counter_hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (h *LogHook) Fire(entry *logrus.Entry) error {
entryMessage = fmt.Sprintf("%s name: /%s", entryMessage, nameField.(string))
}
if isErrorFieldPresent {
entryMessage = fmt.Sprintf("%s error: /%s", entryMessage, errorField.(error).Error())
entryMessage = fmt.Sprintf("%s error: /%v", entryMessage, errorField)
}

if isNamespacePresent {
Expand Down

0 comments on commit 4396be6

Please sign in to comment.