mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-14 22:28:58 +00:00
client-fake object tracker: support merge patch
Signed-off-by: Steve Kriss <krisss@vmware.com> Kubernetes-commit: d425fe29bd808db54c59e3e0ecdedbe735b8f68b
This commit is contained in:
committed by
Kubernetes Publisher
parent
9163569417
commit
f0c6576981
@@ -181,11 +181,11 @@ func TestPatch(t *testing.T) {
|
||||
patchBytes: []byte(`[{"op": "add", "path": "/spec/newvalue", "value": "dummy"}]`),
|
||||
wantErrMsg: "invalid JSON document",
|
||||
}, {
|
||||
name: "merge patch fails as unsupported",
|
||||
object: newUnstructured(testAPIVersion, testKind, testNamespace, testName),
|
||||
patchType: types.MergePatchType,
|
||||
patchBytes: []byte(`{}`),
|
||||
wantErrMsg: "PatchType is not supported",
|
||||
name: "merge patch works with simple replacement",
|
||||
object: newUnstructuredWithSpec(map[string]interface{}{"foo": "bar"}),
|
||||
patchType: types.MergePatchType,
|
||||
patchBytes: []byte(`{ "spec": { "foo": "baz" } }`),
|
||||
expectedPatchedObject: newUnstructuredWithSpec(map[string]interface{}{"foo": "baz"}),
|
||||
},
|
||||
// TODO: Add tests for strategic merge using v1.Pod for example to ensure the test cases
|
||||
// demonstrate expected use cases.
|
||||
|
Reference in New Issue
Block a user