mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-05 04:55:22 +00:00
Allow updated resource version (#6499)
Signed-off-by: Daniel Kucera <daniel.kucera@gmail.com>
This commit is contained in:
@@ -1366,6 +1366,14 @@ 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)
|
||||
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
|
||||
}
|
||||
|
||||
ctx.log.Infof("Attempting to restore %s: %v", obj.GroupVersionKind().Kind, name)
|
||||
createdObj, restoreErr := resourceClient.Create(obj)
|
||||
if restoreErr == nil {
|
||||
|
||||
Reference in New Issue
Block a user