Skip to content

Commit

Permalink
get resource client again after restore actions in case resource's gv…
Browse files Browse the repository at this point in the history
… is changed
  • Loading branch information
27149chen committed Aug 10, 2023
1 parent a88cb46 commit 949a679
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/restore/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -1368,7 +1368,8 @@ func (ctx *restoreContext) restoreItem(obj *unstructured.Unstructured, groupReso

// The object apiVersion might get modified by a RestorePlugin so we need to
// get a new client to reflect updated resource path.
resourceClient, err = ctx.getResourceClient(groupResource, obj, namespace)
newGR := schema.GroupResource{Group: obj.GroupVersionKind().Group, Resource: groupResource.Resource}
resourceClient, err = ctx.getResourceClient(newGR, obj, obj.GetNamespace())
if err != nil {
errs.AddVeleroError(fmt.Errorf("error getting updated resource client for namespace %q, resource %q: %v", namespace, &groupResource, err))
return warnings, errs, itemExists
Expand Down

0 comments on commit 949a679

Please sign in to comment.