support strategic merge patch with $patch: delete

This commit is contained in:
jingfangliu
2019-07-24 12:46:33 -07:00
parent ffd95ef5a9
commit fc78917191
4 changed files with 50 additions and 1 deletions

View File

@@ -338,7 +338,11 @@ func (fs *UnstructAdapter) Patch(patch ifc.Kunstructured) error {
}
}
fs.SetMap(merged)
fs.SetName(saveName)
if len(fs.Map()) != 0 {
// if the patch deletes the object
// don't reset the name
fs.SetName(saveName)
}
return nil
}