mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-09-06 08:07:11 +00:00
* use old namespace in resource modifier * add changelog * update docs * updated after review --------- Signed-off-by: lou <alex1988@outlook.com> Signed-off-by: Anshul Ahuja <anshulahuja@microsoft.com> Co-authored-by: Guang Jiong Lou <7991675+27149chen@users.noreply.github.com> Co-authored-by: Daniel Jiang <jiangd@vmware.com>
This commit is contained in:
co-authored by
Guang Jiong Lou
Daniel Jiang
parent
d9859d99ba
commit
8b8a5a2bcc
@@ -1352,6 +1352,14 @@ func (ctx *restoreContext) restoreItem(obj *unstructured.Unstructured, groupReso
|
||||
}
|
||||
}
|
||||
|
||||
if ctx.resourceModifiers != nil {
|
||||
if errList := ctx.resourceModifiers.ApplyResourceModifierRules(obj, groupResource.String(), ctx.log); errList != nil {
|
||||
for _, err := range errList {
|
||||
errs.Add(namespace, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Necessary because we may have remapped the namespace if the namespace is
|
||||
// blank, don't create the key.
|
||||
originalNamespace := obj.GetNamespace()
|
||||
@@ -1364,14 +1372,6 @@ func (ctx *restoreContext) restoreItem(obj *unstructured.Unstructured, groupReso
|
||||
// and which backup they came from.
|
||||
addRestoreLabels(obj, ctx.restore.Name, ctx.restore.Spec.BackupName)
|
||||
|
||||
if ctx.resourceModifiers != nil {
|
||||
if errList := ctx.resourceModifiers.ApplyResourceModifierRules(obj, groupResource.String(), ctx.log); errList != nil {
|
||||
for _, err := range errList {
|
||||
errs.Add(namespace, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// The object apiVersion might get modified by a RestorePlugin so we need to
|
||||
// get a new client to reflect updated resource path.
|
||||
newGR := schema.GroupResource{Group: obj.GroupVersionKind().Group, Resource: groupResource.Resource}
|
||||
|
||||
Reference in New Issue
Block a user