Skip to content

Commit 449cac5

Browse files
authored
Merge pull request #1032 from mwieczorek/plugins
Move clearing up of metadata before plugin's actions
2 parents 5d039e4 + 7abe115 commit 449cac5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

pkg/restore/restore.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,12 @@ func (ctx *context) restoreResource(resource, namespace, resourcePath string) (a
750750
}
751751
}
752752

753+
// clear out non-core metadata fields & status
754+
if obj, err = resetMetadataAndStatus(obj); err != nil {
755+
addToResult(&errs, namespace, err)
756+
continue
757+
}
758+
753759
for _, action := range applicableActions {
754760
if !action.selector.Matches(labels.Set(obj.GetLabels())) {
755761
continue
@@ -775,12 +781,6 @@ func (ctx *context) restoreResource(resource, namespace, resourcePath string) (a
775781
obj = unstructuredObj
776782
}
777783

778-
// clear out non-core metadata fields & status
779-
if obj, err = resetMetadataAndStatus(obj); err != nil {
780-
addToResult(&errs, namespace, err)
781-
continue
782-
}
783-
784784
// necessary because we may have remapped the namespace
785785
// if the namespace is blank, don't create the key
786786
originalNamespace := obj.GetNamespace()

0 commit comments

Comments
 (0)