[apimachinery] map delete key remove exists check

This commit is contained in:
Gaurav Singh
2020-04-22 00:15:38 -04:00
parent 66fd1335fa
commit 8c1369d5e4

View File

@@ -1321,9 +1321,7 @@ func mergeMap(original, patch map[string]interface{}, schema LookupPatchMeta, me
// Preserving the null value is useful when we want to send an explicit
// delete to the API server.
if patchV == nil {
if _, ok := original[k]; ok {
delete(original, k)
}
delete(original, k)
if mergeOptions.IgnoreUnmatchedNulls {
continue
}