From b39ec75dbd8ec0b0dd5818233be9aa4d9f139ea7 Mon Sep 17 00:00:00 2001 From: Shuting Zhao Date: Wed, 4 Sep 2019 11:58:57 -0700 Subject: [PATCH] fix "failed to patch resource: json: cannot unmarshal array into Go value of type jsonpatch.Operation" --- pkg/engine/patches.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pkg/engine/patches.go b/pkg/engine/patches.go index b140aa1033..0aa6a0514e 100644 --- a/pkg/engine/patches.go +++ b/pkg/engine/patches.go @@ -89,11 +89,9 @@ func ApplyPatches(resource []byte, patches [][]byte) ([]byte, error) { return patchedDocument, err } -//ApplyPatchNew ... +//ApplyPatchNew patches given resource with given joined patches func ApplyPatchNew(resource, patch []byte) ([]byte, error) { - patchesList := [][]byte{patch} - joinedPatches := JoinPatches(patchesList) - jsonpatch, err := jsonpatch.DecodePatch(joinedPatches) + jsonpatch, err := jsonpatch.DecodePatch(patch) if err != nil { return nil, err }