Skip to content

Commit eae8800

Browse files
committed
bump
Signed-off-by: Pavel Okhlopkov <pavel.okhlopkov@flant.com>
1 parent bcc2a74 commit eae8800

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

pkg/kube/object_patch/operation.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,11 +296,11 @@ func NewPatchWithJQOperation(jqfilter string, apiVersion string, kind string, na
296296
}, apiVersion, kind, namespace, name, opts...)
297297
}
298298

299-
func NewPatchWithMutatingFuncOperation(fn MutatingFunc, apiVersion string, kind string, namespace string, name string, opts ...sdkpkg.PatchCollectorOption) sdkpkg.PatchCollectorOperation {
299+
func NewPatchWithMutatingFuncOperation(fn func(*unstructured.Unstructured) (*unstructured.Unstructured, error), apiVersion string, kind string, namespace string, name string, opts ...sdkpkg.PatchCollectorOption) sdkpkg.PatchCollectorOperation {
300300
return newFilterOperation(fn, apiVersion, kind, namespace, name, opts...)
301301
}
302302

303-
func newFilterOperation(fn MutatingFunc, apiVersion, kind, namespace, name string, opts ...sdkpkg.PatchCollectorOption) sdkpkg.PatchCollectorOperation {
303+
func newFilterOperation(fn func(*unstructured.Unstructured) (*unstructured.Unstructured, error), apiVersion, kind, namespace, name string, opts ...sdkpkg.PatchCollectorOption) sdkpkg.PatchCollectorOperation {
304304
op := &patchOperation{
305305
apiVersion: apiVersion,
306306
kind: kind,

pkg/kube/object_patch/patch_collector.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ import (
55
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
66
)
77

8-
type MutatingFunc func(*unstructured.Unstructured) (*unstructured.Unstructured, error)
9-
108
type IPatchCollector interface {
119
sdkpkg.PatchCollector
1210

13-
PatchWithMutatingFunc(fn MutatingFunc, apiVersion string, kind string, namespace string, name string, opts ...sdkpkg.PatchCollectorOption)
11+
PatchWithMutatingFunc(fn func(*unstructured.Unstructured) (*unstructured.Unstructured, error), apiVersion string, kind string, namespace string, name string, opts ...sdkpkg.PatchCollectorOption)
1412
}
1513

1614
var _ IPatchCollector = (*PatchCollector)(nil)
@@ -114,7 +112,7 @@ func (dop *PatchCollector) JSONPatch(jsonPatch any, apiVersion, kind, namespace,
114112
// Note: do not modify and return argument in filterFunc,
115113
// use FromUnstructured to instantiate a concrete type or modify after DeepCopy.
116114
func (dop *PatchCollector) PatchWithMutatingFunc(
117-
fn MutatingFunc,
115+
fn func(*unstructured.Unstructured) (*unstructured.Unstructured, error),
118116
apiVersion, kind, namespace, name string, opts ...sdkpkg.PatchCollectorOption,
119117
) {
120118
dop.add(NewPatchWithMutatingFuncOperation(fn, apiVersion, kind, namespace, name, opts...))

0 commit comments

Comments
 (0)