Skip to content

Commit

Permalink
Move clearing up of metadata before plugin's actions
Browse files Browse the repository at this point in the history
Signed-off-by: Michal Wieczorek <[email protected]>
  • Loading branch information
mwieczorek committed Nov 2, 2018
1 parent 7c62ed2 commit 7abe115
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pkg/restore/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,12 @@ func (ctx *context) restoreResource(resource, namespace, resourcePath string) (a
}
}

// clear out non-core metadata fields & status
if obj, err = resetMetadataAndStatus(obj); err != nil {
addToResult(&errs, namespace, err)
continue
}

for _, action := range applicableActions {
if !action.selector.Matches(labels.Set(obj.GetLabels())) {
continue
Expand All @@ -765,12 +771,6 @@ func (ctx *context) restoreResource(resource, namespace, resourcePath string) (a
obj = unstructuredObj
}

// clear out non-core metadata fields & status
if obj, err = resetMetadataAndStatus(obj); err != nil {
addToResult(&errs, namespace, err)
continue
}

// necessary because we may have remapped the namespace
// if the namespace is blank, don't create the key
originalNamespace := obj.GetNamespace()
Expand Down

0 comments on commit 7abe115

Please sign in to comment.