Skip to content

Commit

Permalink
Merge pull request #6110 from ywk253100/230411_mf
Browse files Browse the repository at this point in the history
Ignore not found error during patching managedFields
  • Loading branch information
reasonerjt authored Apr 11, 2023
2 parents 7d0d56e + 5c0c378 commit c3e7fd7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions changelogs/CHANGELOG-1.11.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ To fix CVEs and keep pace with Golang, Velero made changes as follows:


### All Changes
* Ignore not found error during patching managedFields (#6110, @ywk253100)
* Modify new scope resource filters name. (#6089, @blackpiglet)
* Make Velero not exits when EnableCSI is on and CSI snapshot not installed (#6062, @blackpiglet)
* Restore Services before Clusters (#6057, @ywk253100)
Expand Down
9 changes: 6 additions & 3 deletions pkg/restore/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -1514,10 +1514,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, itemExists
if !apierrors.IsNotFound(err) {
errs.Add(namespace, err)
return warnings, errs, itemExists
}
} 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

0 comments on commit c3e7fd7

Please sign in to comment.