Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 38 additions & 7 deletions merge/leaf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ func TestUpdateLeaf(t *testing.T) {
),
},
},
"apply_twice_dangling": {
"apply_twice_remove": {
Ops: []Operation{
Apply{
Manager: "default",
Expand All @@ -365,9 +365,7 @@ func TestUpdateLeaf(t *testing.T) {
},
},
Object: `
numeric: 1
string: "new string"
bool: false
`,
APIVersion: "v1",
Managed: fieldpath.ManagedFields{
Expand All @@ -380,7 +378,43 @@ func TestUpdateLeaf(t *testing.T) {
),
},
},
"apply_twice_dangling_different_version": {
"update_apply_omits": {
Ops: []Operation{
Apply{
Manager: "default",
APIVersion: "v1",
Object: `
numeric: 2
`,
},
Update{
Manager: "controller",
APIVersion: "v1",
Object: `
numeric: 1
`,
},
Apply{
Manager: "default",
APIVersion: "v1",
Object: ``,
},
},
Object: `
numeric: 1
`,
APIVersion: "v1",
Managed: fieldpath.ManagedFields{
"controller": fieldpath.NewVersionedSet(
_NS(
_P("numeric"),
),
"v1",
false,
),
},
},
"apply_twice_remove_different_version": {
Ops: []Operation{
Apply{
Manager: "default",
Expand All @@ -400,9 +434,7 @@ func TestUpdateLeaf(t *testing.T) {
},
},
Object: `
numeric: 1
string: "new string"
bool: false
`,
APIVersion: "v1",
Managed: fieldpath.ManagedFields{
Expand Down Expand Up @@ -462,7 +494,6 @@ func TestUpdateLeaf(t *testing.T) {
},
},
Object: `
string: "string"
`,
APIVersion: "v1",
Managed: fieldpath.ManagedFields{},
Expand Down
Loading