Skip to content

Commit 7af930f

Browse files
authored
Merge pull request kubernetes#92517 from gaurav1086/mergeMap_remove_map_nil_check
[apimachinery] Remove map nil check before delete in mergeMap
2 parents 5fe980b + 5e0b20f commit 7af930f

File tree

1 file changed

+1
-3
lines changed
  • staging/src/k8s.io/apimachinery/pkg/util/strategicpatch

1 file changed

+1
-3
lines changed

staging/src/k8s.io/apimachinery/pkg/util/strategicpatch/patch.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,9 +1321,7 @@ func mergeMap(original, patch map[string]interface{}, schema LookupPatchMeta, me
13211321
// Preserving the null value is useful when we want to send an explicit
13221322
// delete to the API server.
13231323
if patchV == nil {
1324-
if _, ok := original[k]; ok {
1325-
delete(original, k)
1326-
}
1324+
delete(original, k)
13271325
if mergeOptions.IgnoreUnmatchedNulls {
13281326
continue
13291327
}

0 commit comments

Comments
 (0)