Merge pull request #1032 from mwieczorek/plugins

Move clearing up of metadata before plugin's actions
pull/1006/head
Steve Kriss 2018-11-08 12:00:33 -07:00 committed by GitHub
commit 449cac5806
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

View File

@ -750,6 +750,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
@ -775,12 +781,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()