mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 12:15:52 +00:00
add ut for preventing dropping null from arrays
Signed-off-by: pacoxu <paco.xu@daocloud.io>
This commit is contained in:
parent
6e0650e3e1
commit
ceaf9b9d16
@ -602,6 +602,57 @@ testCases:
|
|||||||
- false
|
- false
|
||||||
- b: 1
|
- b: 1
|
||||||
bar: 0
|
bar: 0
|
||||||
|
- description: patch array with nil
|
||||||
|
original:
|
||||||
|
foo:
|
||||||
|
- a: true
|
||||||
|
- null
|
||||||
|
- false
|
||||||
|
bar: []
|
||||||
|
drop:
|
||||||
|
- 1
|
||||||
|
modified:
|
||||||
|
foo:
|
||||||
|
- 1
|
||||||
|
- false
|
||||||
|
- b: 1
|
||||||
|
bar:
|
||||||
|
- c
|
||||||
|
- null
|
||||||
|
- null
|
||||||
|
- a
|
||||||
|
drop:
|
||||||
|
- null
|
||||||
|
current:
|
||||||
|
foo:
|
||||||
|
- a: true
|
||||||
|
- 2
|
||||||
|
- false
|
||||||
|
bar:
|
||||||
|
- c
|
||||||
|
- null
|
||||||
|
- null
|
||||||
|
- a
|
||||||
|
drop:
|
||||||
|
threeWay:
|
||||||
|
foo:
|
||||||
|
- 1
|
||||||
|
- false
|
||||||
|
- b: 1
|
||||||
|
drop:
|
||||||
|
- null
|
||||||
|
result:
|
||||||
|
foo:
|
||||||
|
- 1
|
||||||
|
- false
|
||||||
|
- b: 1
|
||||||
|
drop:
|
||||||
|
- null
|
||||||
|
bar:
|
||||||
|
- c
|
||||||
|
- null
|
||||||
|
- null
|
||||||
|
- a
|
||||||
`)
|
`)
|
||||||
|
|
||||||
func TestCreateThreeWayJSONMergePatch(t *testing.T) {
|
func TestCreateThreeWayJSONMergePatch(t *testing.T) {
|
||||||
|
Loading…
Reference in New Issue
Block a user