Documentation ¶
Index ¶
- type Client
- func (f Client) Clear()
- func (f Client) Create(_ context.Context, obj client.Object, _ ...client.CreateOption) error
- func (f Client) Delete(_ context.Context, obj client.Object, opts ...client.DeleteOption) error
- func (f Client) DeleteAllOf(_ context.Context, _ client.Object, _ ...client.DeleteAllOfOption) error
- func (f Client) Get(_ context.Context, key client.ObjectKey, obj client.Object, ...) error
- func (f Client) GroupVersionKindFor(_ runtime.Object) (schema.GroupVersionKind, error)
- func (f Client) IsObjectNamespaced(_ runtime.Object) (bool, error)
- func (f Client) List(ctx context.Context, list client.ObjectList, _ ...client.ListOption) error
- func (f Client) Patch(_ context.Context, _ client.Object, _ client.Patch, _ ...client.PatchOption) error
- func (f Client) RESTMapper() meta.RESTMapper
- func (f Client) Scheme() *runtime.Scheme
- func (f Client) SetDeletionTimeStamp(_ context.Context, obj client.Object) error
- func (f Client) Status() client.SubResourceWriter
- func (f Client) SubResource(subResource string) client.SubResourceClient
- func (f Client) Update(_ context.Context, obj client.Object, _ ...client.UpdateOption) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Objects map[shared.StorageKey]runtime.Object ErrorInjector shared.ErrorInjector }
Client implements a controller runtime client Objects mocks k8s resources ErrorInjector is used to force errors from controller for test
func NewFakeClient ¶
func NewFakeClient(objectMap map[shared.StorageKey]runtime.Object, errorInjector shared.ErrorInjector) *Client
NewFakeClient creates a new client
func NewFakeClientNoInjector ¶
func NewFakeClientNoInjector(objectMap map[shared.StorageKey]runtime.Object) *Client
NewFakeClientNoInjector creates a new client without an error injector
func (Client) DeleteAllOf ¶
func (f Client) DeleteAllOf(_ context.Context, _ client.Object, _ ...client.DeleteAllOfOption) error
DeleteAllOf implements client.Client.
func (Client) Get ¶
func (f Client) Get(_ context.Context, key client.ObjectKey, obj client.Object, _ ...client.GetOption) error
Get implements client.Client.
func (Client) GroupVersionKindFor ¶ added in v1.3.0
GroupVersionKindFor returns the GroupVersionKind for the given object.
func (Client) IsObjectNamespaced ¶ added in v1.3.0
IsObjectNamespaced returns true if the GroupVersionKind of the object is namespaced.
func (Client) List ¶
func (f Client) List(ctx context.Context, list client.ObjectList, _ ...client.ListOption) error
List implements client.Client.
func (Client) Patch ¶
func (f Client) Patch(_ context.Context, _ client.Object, _ client.Patch, _ ...client.PatchOption) error
Patch implements client.Client.
func (Client) RESTMapper ¶
func (f Client) RESTMapper() meta.RESTMapper
RESTMapper returns the scheme this client is using.
func (Client) SetDeletionTimeStamp ¶
SetDeletionTimeStamp so that reconcile can go into deletion part of code
func (Client) Status ¶
func (f Client) Status() client.SubResourceWriter
Status implements client.StatusClient.
func (Client) SubResource ¶ added in v1.3.0
func (f Client) SubResource(subResource string) client.SubResourceClient
SubResource returns a subresource with the name specified in subResource