From c49147802dc5e5005dd83d9f839c303c480d2834 Mon Sep 17 00:00:00 2001 From: Chris Bandy Date: Wed, 3 Mar 2021 19:50:11 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20client.Apply=20and=20clien?= =?UTF-8?q?t.Merge=20to=20satisfy=20Patch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit a79f6f135357 changed the Patch interface but missed these two implementations. Their exported variable declarations will catch this next time. --- pkg/client/patch.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pkg/client/patch.go b/pkg/client/patch.go index 260db896fb..38c3856809 100644 --- a/pkg/client/patch.go +++ b/pkg/client/patch.go @@ -20,18 +20,17 @@ import ( "fmt" jsonpatch "github.com/evanphx/json-patch" - "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/json" ) var ( // Apply uses server-side apply to patch the given object. - Apply = applyPatch{} + Apply Patch = applyPatch{} // Merge uses the raw object as a merge patch, without modifications. // Use MergeFrom if you wish to compute a diff instead. - Merge = mergePatch{} + Merge Patch = mergePatch{} ) type patch struct { @@ -89,7 +88,7 @@ type mergeFromPatch struct { opts MergeFromOptions } -// Type implements patch. +// Type implements Patch. func (s *mergeFromPatch) Type() types.PatchType { return types.MergePatchType } @@ -153,7 +152,7 @@ func (p mergePatch) Type() types.PatchType { } // Data implements Patch. -func (p mergePatch) Data(obj runtime.Object) ([]byte, error) { +func (p mergePatch) Data(obj Object) ([]byte, error) { // NB(directxman12): we might technically want to be using an actual encoder // here (in case some more performant encoder is introduced) but this is // correct and sufficient for our uses (it's what the JSON serializer in @@ -170,7 +169,7 @@ func (p applyPatch) Type() types.PatchType { } // Data implements Patch. -func (p applyPatch) Data(obj runtime.Object) ([]byte, error) { +func (p applyPatch) Data(obj Object) ([]byte, error) { // NB(directxman12): we might technically want to be using an actual encoder // here (in case some more performant encoder is introduced) but this is // correct and sufficient for our uses (it's what the JSON serializer in