@@ -7,6 +7,7 @@ package runtime
77import (
88 "context"
99
10+ "k8s.io/apimachinery/pkg/runtime"
1011 "k8s.io/client-go/rest"
1112 "sigs.k8s.io/controller-runtime/pkg/client"
1213)
3233 ClientPatch func (context.Context , client.Object , client.Patch , ... client.PatchOption ) error
3334 ClientDeleteAll func (context.Context , client.Object , ... client.DeleteAllOfOption ) error
3435 ClientUpdate func (context.Context , client.Object , ... client.UpdateOption ) error
36+ ClientApply func (context.Context , runtime.ApplyConfiguration , ... client.ApplyOption ) error
3537)
3638
3739// ClientWriter implements [client.Writer] by composing assignable functions.
@@ -41,6 +43,7 @@ type ClientWriter struct {
4143 ClientDeleteAll
4244 ClientPatch
4345 ClientUpdate
46+ ClientApply
4447}
4548
4649var _ client.Writer = ClientWriter {}
@@ -76,6 +79,10 @@ func (fn ClientUpdate) Update(ctx context.Context, obj client.Object, opts ...cl
7679 return fn (ctx , obj , opts ... )
7780}
7881
82+ func (fn ClientApply ) Apply (ctx context.Context , obj runtime.ApplyConfiguration , opts ... client.ApplyOption ) error {
83+ return fn (ctx , obj , opts ... )
84+ }
85+
7986// WarningHandler implements [rest.WarningHandler] and [rest.WarningHandlerWithContext] as a single function.
8087type WarningHandler func (ctx context.Context , code int , agent string , text string )
8188
0 commit comments