Skip to content

Commit e4aff1b

Browse files
committed
add comment for mergeMap
1 parent 8483b9c commit e4aff1b

File tree

1 file changed

+4
-0
lines changed
  • staging/src/k8s.io/apimachinery/pkg/util/strategicpatch

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1361,6 +1361,10 @@ func mergeMap(original, patch map[string]interface{}, schema LookupPatchMeta, me
13611361
// original. Otherwise, check if we want to preserve it or skip it.
13621362
// Preserving the null value is useful when we want to send an explicit
13631363
// delete to the API server.
1364+
// In some cases, this may lead to inconsistent behavior with create.
1365+
// ref: https://github.com/kubernetes/kubernetes/issues/123304
1366+
// To avoid breaking compatibility,
1367+
// we made corresponding changes on the client side to ensure that the create and patch behaviors are idempotent.
13641368
if patchV == nil {
13651369
delete(original, k)
13661370
if mergeOptions.IgnoreUnmatchedNulls {

0 commit comments

Comments
 (0)