@@ -10,8 +10,7 @@ import (
10
10
"sigs.k8s.io/controller-runtime/pkg/client"
11
11
)
12
12
13
- // NewClient returns a new interceptor client that calls the functions in fns
14
- // instead of the underlying client's methods, if they are not nil.
13
+ // NewClient returns a new interceptor client that calls the functions in fns instead of the underlying client's methods, if they are not nil.
15
14
func NewClient (client client.WithWatch , fns Fns ) client.WithWatch {
16
15
return interceptor {client : client , fns : fns }
17
16
}
45
44
// SubResourcePatchFn is a function that can be used to intercept SubResource PATCH calls.
46
45
SubResourcePatchFn func (ctx context.Context , client client.SubResourceClient , obj client.Object , patch client.Patch , opts ... client.SubResourcePatchOption ) error
47
46
48
- // Fns contains functions that are called instead of the underlying
49
- // client's methods.
47
+ // Fns contains functions that are called instead of the underlying client's methods.
50
48
Fns struct {
51
49
Get GetFn
52
50
List ListFn
59
57
SubResource SubResourceFn
60
58
}
61
59
62
- // SubResourceFns is a set of functions that can be used to intercept
63
- // calls to a SubResourceClient.
60
+ // SubResourceFns is a set of functions that can be used to intercept calls to a SubResourceClient.
64
61
SubResourceFns struct {
65
62
Get SubResourceGetFn
66
63
Create SubResourceCreateFn
@@ -166,8 +163,7 @@ type subResourceInterceptor struct {
166
163
167
164
var _ client.SubResourceClient = & subResourceInterceptor {}
168
165
169
- // NewSubResourceClient returns a SubResourceClient that intercepts calls to
170
- // the provided client with the provided functions.
166
+ // NewSubResourceClient returns a SubResourceClient that intercepts calls to the provided client with the provided functions.
171
167
func NewSubResourceClient (client client.SubResourceClient , fns SubResourceFns ) client.SubResourceClient {
172
168
return subResourceInterceptor {client : client , fns : fns }
173
169
}
0 commit comments