Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for CreateThreeWayJSONMergePatch (0.54 sec)

  1. staging/src/k8s.io/apimachinery/pkg/util/jsonmergepatch/patch.go

    )
    
    // Create a 3-way merge patch based-on JSON merge patch.
    // Calculate addition-and-change patch between current and modified.
    // Calculate deletion patch between original and modified.
    func CreateThreeWayJSONMergePatch(original, modified, current []byte, fns ...mergepatch.PreconditionFunc) ([]byte, error) {
    	if len(original) == 0 {
    		original = []byte(`{}`)
    	}
    	if len(modified) == 0 {
    		modified = []byte(`{}`)
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue May 28 08:48:22 UTC 2024
    - 4.8K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apimachinery/pkg/util/jsonmergepatch/patch_test.go

    		testThreeWayPatch(t, c)
    	}
    }
    
    func testThreeWayPatch(t *testing.T, c JSONMergePatchTestCase) {
    	original, modified, current, expected, result := threeWayTestCaseToJSONOrFail(t, c)
    	actual, err := CreateThreeWayJSONMergePatch(original, modified, current)
    	if err != nil {
    		t.Fatalf("error: %s", err)
    	}
    	testPatchCreation(t, expected, actual, c.Description)
    	testPatchApplication(t, current, actual, result, c.Description)
    }
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue May 28 08:48:22 UTC 2024
    - 14.8K bytes
    - Viewed (0)
Back to top