[apimachinery] Remove map nil check before delete in mergeMap

Signed-off-by: Gaurav Singh <gaurav1086@gmail.com>
This commit is contained in:
Gaurav Singh 2020-06-25 12:08:52 -04:00
parent 3c31a0026a
commit 5e0b20fcd6

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
}