From 7182169cc5fe663e73f0c209606bc6ea64b6fb67 Mon Sep 17 00:00:00 2001 From: Maxim Ivanov Date: Sun, 9 Jan 2022 12:29:05 +0000 Subject: [PATCH] Add test to verify that apply after update should work with no conflict --- merge/leaf_test.go | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/merge/leaf_test.go b/merge/leaf_test.go index ab6d59ae..dc655b17 100644 --- a/merge/leaf_test.go +++ b/merge/leaf_test.go @@ -47,6 +47,37 @@ var leafFieldsParser = func() Parser { func TestUpdateLeaf(t *testing.T) { tests := map[string]TestCase{ + "update_apply": { + Ops: []Operation{ + Update{ + Manager: "default", + Object: ` + numeric: 1 + `, + APIVersion: "v1", + }, + Apply{ + Manager: "default", + Object: ` + numeric: 2 + `, + APIVersion: "v1", + }, + }, + Object: ` + numeric: 2 + `, + APIVersion: "v1", + Managed: fieldpath.ManagedFields{ + "default": fieldpath.NewVersionedSet( + _NS( + _P("numeric"), + ), + "v1", + true, + ), + }, + }, "apply_twice": { Ops: []Operation{ Apply{