Documentation
¶
Index ¶
- Constants
- type FakeClient
- func (c *FakeClient) Create(ctx context.Context, obj runtime.Object, opts ...client.CreateOption) error
- func (c *FakeClient) Delete(ctx context.Context, obj runtime.Object, opts ...client.DeleteOption) error
- func (c *FakeClient) DeleteAllOf(ctx context.Context, obj runtime.Object, opts ...client.DeleteAllOfOption) error
- func (c *FakeClient) Get(ctx context.Context, key client.ObjectKey, obj runtime.Object) error
- func (c *FakeClient) List(ctx context.Context, list runtime.Object, opts ...client.ListOption) error
- func (c *FakeClient) Status() client.StatusWriter
- func (c *FakeClient) Update(ctx context.Context, obj runtime.Object, opts ...client.UpdateOption) error
Constants ¶
View Source
const ( TestType = "TEST_TYPE" E2e = "E2E" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeClient ¶
type FakeClient struct {
client.Client
T *testing.T
MockGet func(ctx context.Context, key client.ObjectKey, obj runtime.Object) error
MockList func(ctx context.Context, list runtime.Object, opts ...client.ListOption) error
MockCreate func(ctx context.Context, obj runtime.Object, opts ...client.CreateOption) error
MockUpdate func(ctx context.Context, obj runtime.Object, opts ...client.UpdateOption) error
MockPatch func(ctx context.Context, obj runtime.Object, patch client.Patch, opts ...client.PatchOption) error
MockStatusUpdate func(ctx context.Context, obj runtime.Object, opts ...client.UpdateOption) error
MockStatusPatch func(ctx context.Context, obj runtime.Object, patch client.Patch, opts ...client.PatchOption) error
MockDelete func(ctx context.Context, obj runtime.Object, opts ...client.DeleteOption) error
MockDeleteAllOf func(ctx context.Context, obj runtime.Object, opts ...client.DeleteAllOfOption) error
}
func NewFakeClient ¶
func NewFakeClient(t *testing.T, initObjs ...runtime.Object) *FakeClient
NewFakeClient creates a fake K8s client with ability to override specific Get/List/Create/Update/StatusUpdate/Delete functions
func (*FakeClient) Create ¶
func (c *FakeClient) Create(ctx context.Context, obj runtime.Object, opts ...client.CreateOption) error
func (*FakeClient) Delete ¶
func (c *FakeClient) Delete(ctx context.Context, obj runtime.Object, opts ...client.DeleteOption) error
func (*FakeClient) DeleteAllOf ¶
func (c *FakeClient) DeleteAllOf(ctx context.Context, obj runtime.Object, opts ...client.DeleteAllOfOption) error
func (*FakeClient) List ¶
func (c *FakeClient) List(ctx context.Context, list runtime.Object, opts ...client.ListOption) error
func (*FakeClient) Status ¶
func (c *FakeClient) Status() client.StatusWriter
func (*FakeClient) Update ¶
func (c *FakeClient) Update(ctx context.Context, obj runtime.Object, opts ...client.UpdateOption) error
Click to show internal directories.
Click to hide internal directories.