Documentation ¶
Overview ¶
Package fake provides fake dynamic clients and reactors for testing purposes.
Index ¶
- func AddBasicReactors(f *testing.Fake)
- func AddCreateReactor(f *testing.Fake)
- func AddDeleteCollectionReactor(f *testing.Fake)
- func AddDeleteReactor(f *testing.Fake)
- func AddFilteringListReactor(f *testing.Fake)
- func AddFilteringWatchReactor(f *testing.Fake)
- func AddUpdateReactor(f *testing.Fake)
- func AddVerifyNamespaceReactor(f *testing.Fake, resources ...string)
- func ConflictOnUpdateReactor(f *testing.Fake, resource string)
- func FailingReaction(err error) func(obj interface{}) (bool, error)
- type DeleteCollectionReactor
- type FailOnActionReactor
- type FailingReactor
- func (f *FailingReactor) SetFailOnCreate(err error)
- func (f *FailingReactor) SetFailOnDelete(err error)
- func (f *FailingReactor) SetFailOnGet(err error)
- func (f *FailingReactor) SetFailOnList(err error)
- func (f *FailingReactor) SetFailOnUpdate(err error)
- func (f *FailingReactor) SetResetOnFailure(v bool)
- type ReactingClient
- func (c *ReactingClient) AddReactor(verb VerbType, objType interface{}, r ReactionFunc) *ReactingClient
- func (c *ReactingClient) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error
- func (c *ReactingClient) Delete(ctx context.Context, obj client.Object, opts ...client.DeleteOption) error
- func (c *ReactingClient) Get(ctx context.Context, key client.ObjectKey, obj client.Object, ...) error
- func (c *ReactingClient) List(ctx context.Context, list client.ObjectList, opts ...client.ListOption) error
- func (c *ReactingClient) Update(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error
- type ReactionFunc
- type VerbType
- type WatchReactor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddBasicReactors ¶ added in v0.16.0
AddBasicReactors adds reactors to mimic real K8s behavior for create, update, delete, list, watchs.
func AddCreateReactor ¶ added in v0.16.0
AddCreateReactor adds a reactor to mimic real K8s create behavior to handle GenerateName, validation et al.
func AddDeleteCollectionReactor ¶ added in v0.6.2
func AddDeleteReactor ¶ added in v0.16.0
AddDeleteReactor adds a reactor to mimic real K8s delete behavior to handle ResourceVersion, DeletionTimestamp et al.
func AddFilteringListReactor ¶ added in v0.12.0
func AddFilteringWatchReactor ¶ added in v0.16.0
func AddUpdateReactor ¶ added in v0.16.0
AddUpdateReactor adds a reactor to mimic real K8s update behavior to handle ResourceVersion et al.
func AddVerifyNamespaceReactor ¶ added in v0.17.2
func ConflictOnUpdateReactor ¶ added in v0.12.0
func FailingReaction ¶ added in v0.14.0
Types ¶
type DeleteCollectionReactor ¶ added in v0.6.2
type DeleteCollectionReactor struct {
// contains filtered or unexported fields
}
type FailOnActionReactor ¶ added in v0.12.0
type FailOnActionReactor struct {
// contains filtered or unexported fields
}
func FailOnAction ¶ added in v0.12.0
func (*FailOnActionReactor) Fail ¶ added in v0.12.0
func (r *FailOnActionReactor) Fail(v bool)
type FailingReactor ¶ added in v0.6.1
type FailingReactor struct {
// contains filtered or unexported fields
}
func NewFailingReactor ¶ added in v0.6.1
func NewFailingReactor(f *testing.Fake) *FailingReactor
func NewFailingReactorForResource ¶ added in v0.6.1
func NewFailingReactorForResource(f *testing.Fake, resource string) *FailingReactor
func (*FailingReactor) SetFailOnCreate ¶ added in v0.6.1
func (f *FailingReactor) SetFailOnCreate(err error)
func (*FailingReactor) SetFailOnDelete ¶ added in v0.6.1
func (f *FailingReactor) SetFailOnDelete(err error)
func (*FailingReactor) SetFailOnGet ¶ added in v0.6.1
func (f *FailingReactor) SetFailOnGet(err error)
func (*FailingReactor) SetFailOnList ¶ added in v0.6.1
func (f *FailingReactor) SetFailOnList(err error)
func (*FailingReactor) SetFailOnUpdate ¶ added in v0.6.1
func (f *FailingReactor) SetFailOnUpdate(err error)
func (*FailingReactor) SetResetOnFailure ¶ added in v0.6.1
func (f *FailingReactor) SetResetOnFailure(v bool)
type ReactingClient ¶ added in v0.14.0
func NewReactingClient ¶ added in v0.14.0
func NewReactingClient(c client.Client) *ReactingClient
func (*ReactingClient) AddReactor ¶ added in v0.14.0
func (c *ReactingClient) AddReactor(verb VerbType, objType interface{}, r ReactionFunc) *ReactingClient
func (*ReactingClient) Create ¶ added in v0.14.0
func (c *ReactingClient) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error
func (*ReactingClient) Delete ¶ added in v0.14.0
func (c *ReactingClient) Delete(ctx context.Context, obj client.Object, opts ...client.DeleteOption) error
func (*ReactingClient) List ¶ added in v0.14.0
func (c *ReactingClient) List(ctx context.Context, list client.ObjectList, opts ...client.ListOption) error
func (*ReactingClient) Update ¶ added in v0.14.0
func (c *ReactingClient) Update(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error
type ReactionFunc ¶ added in v0.14.0
type WatchReactor ¶ added in v0.10.1
type WatchReactor struct {
// contains filtered or unexported fields
}
func NewWatchReactor ¶ added in v0.10.1
func NewWatchReactor(f *testing.Fake) *WatchReactor
func (*WatchReactor) AwaitNoWatchStarted ¶ added in v0.10.1
func (r *WatchReactor) AwaitNoWatchStarted(forResource string)
func (*WatchReactor) AwaitNoWatchStopped ¶ added in v0.10.1
func (r *WatchReactor) AwaitNoWatchStopped(forResource string)
func (*WatchReactor) AwaitWatchStarted ¶ added in v0.10.1
func (r *WatchReactor) AwaitWatchStarted(forResource string)
func (*WatchReactor) AwaitWatchStopped ¶ added in v0.10.1
func (r *WatchReactor) AwaitWatchStopped(forResource string)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.