Merge pull request #92517 from gaurav1086/mergeMap_remove_map_nil_check

[apimachinery] Remove map nil check before delete in mergeMap
This commit is contained in:
Kubernetes Prow Robot 2020-07-01 00:07:36 -07:00 committed by GitHub
commit 7af930f2b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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
}