Don't swallow error in SM patch and use new RNode Map method.

This commit is contained in:
monopole
2021-01-09 06:57:29 -08:00
parent 1a002005c1
commit c2fbb709da
5 changed files with 26 additions and 19 deletions

View File

@@ -423,9 +423,12 @@ func (r *Resource) ApplySmPatch(patch *Resource) error {
return err
}
n, ns := r.GetName(), r.GetNamespace()
r.ApplyFilter(patchstrategicmerge.Filter{
err = r.ApplyFilter(patchstrategicmerge.Filter{
Patch: node,
})
if err != nil {
return err
}
if !r.IsEmpty() {
r.SetName(n)
r.SetNamespace(ns)