Documentation ¶
Index ¶
- type Client
- func (f Client) Create(_ context.Context, obj client.Object, _ ...client.CreateOption) error
- func (f Client) Delete(ctx 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) List(_ context.Context, list client.ObjectList, opts ...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.StatusWriter
- func (f Client) Update(_ context.Context, obj client.Object, _ ...client.UpdateOption) error
- type ErrorInjector
- type MockUtils
- type StorageKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Objects map[StorageKey]runtime.Object ErrorInjector ErrorInjector }
Client Objects mocks k8s resources ErrorInjector is used to force errors from controller for test refer steps.go in int-test folder
func NewFakeClient ¶
func NewFakeClient(initialObjects []runtime.Object, errorInjector ErrorInjector) (*Client, error)
NewFakeClient create fake client
func (Client) DeleteAllOf ¶
func (f Client) DeleteAllOf(_ context.Context, _ client.Object, _ ...client.DeleteAllOfOption) error
DeleteAllOf delete all objects
func (Client) List ¶
func (f Client) List(_ context.Context, list client.ObjectList, opts ...client.ListOption) error
List fake objects
func (Client) Patch ¶
func (f Client) Patch(_ context.Context, _ client.Object, _ client.Patch, _ ...client.PatchOption) error
Patch fake object
func (Client) SetDeletionTimeStamp ¶
SetDeletionTimeStamp set deletion timestamp so that reconcile can go into deletion part of code
type ErrorInjector ¶
ErrorInjector to force error
type MockUtils ¶
type MockUtils struct { // FakeClient client FakeClient *Client // Specs client.WithWatch Specs common.Common }
MockUtils fake struct
type StorageKey ¶
StorageKey metadata of object to store
Click to show internal directories.
Click to hide internal directories.