Skip to content

Commit 5e0b20f

Browse files
committed
[apimachinery] Remove map nil check before delete in mergeMap
Signed-off-by: Gaurav Singh <[email protected]>
1 parent 3c31a00 commit 5e0b20f

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)