Documentation ¶
Overview ¶
Package fake provides fake dynamic clients and reactors for testing purposes.
Index ¶
- func AddDeleteCollectionReactor(f *testing.Fake, gvk schema.GroupVersionKind)
- func AddFilteringListReactor(f *testing.Fake)
- func ConflictOnUpdateReactor(f *testing.Fake, resource string)
- func FailingReaction(err error) func(obj interface{}) (bool, error)
- type DeleteCollectionReactor
- type DynamicClient
- type DynamicResourceClient
- func (f *DynamicResourceClient) Create(ctx context.Context, obj *unstructured.Unstructured, options v1.CreateOptions, ...) (*unstructured.Unstructured, error)
- func (f *DynamicResourceClient) Delete(ctx context.Context, name string, options v1.DeleteOptions, ...) error
- func (f *DynamicResourceClient) Get(ctx context.Context, name string, options v1.GetOptions, ...) (*unstructured.Unstructured, error)
- func (f *DynamicResourceClient) Update(ctx context.Context, obj *unstructured.Unstructured, options v1.UpdateOptions, ...) (*unstructured.Unstructured, error)
- func (f *DynamicResourceClient) VerifyNoCreate(name string)
- func (f *DynamicResourceClient) VerifyNoDelete(name string)
- func (f *DynamicResourceClient) VerifyNoUpdate(name string)
- 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 AddDeleteCollectionReactor ¶
func AddDeleteCollectionReactor(f *testing.Fake, gvk schema.GroupVersionKind)
func AddFilteringListReactor ¶
func ConflictOnUpdateReactor ¶
func FailingReaction ¶
Types ¶
type DeleteCollectionReactor ¶
type DeleteCollectionReactor struct {
// contains filtered or unexported fields
}
type DynamicClient ¶
type DynamicClient struct { *fake.FakeDynamicClient // contains filtered or unexported fields }
func NewDynamicClient ¶
func NewDynamicClient(scheme *runtime.Scheme, objects ...runtime.Object) *DynamicClient
func (*DynamicClient) Resource ¶
func (f *DynamicClient) Resource(gvr schema.GroupVersionResource) dynamic.NamespaceableResourceInterface
type DynamicResourceClient ¶
type DynamicResourceClient struct { dynamic.ResourceInterface FailOnCreate error PersistentFailOnCreate atomic.Value FailOnUpdate error PersistentFailOnUpdate atomic.Value CheckResourceVersionOnUpdate bool FailOnDelete error PersistentFailOnDelete atomic.Value FailOnGet error PersistentFailOnGet atomic.Value // contains filtered or unexported fields }
func (*DynamicResourceClient) Create ¶
func (f *DynamicResourceClient) Create(ctx context.Context, obj *unstructured.Unstructured, options v1.CreateOptions, subresources ...string, ) (*unstructured.Unstructured, error)
func (*DynamicResourceClient) Delete ¶
func (f *DynamicResourceClient) Delete(ctx context.Context, name string, options v1.DeleteOptions, subresources ...string, ) error
func (*DynamicResourceClient) Get ¶
func (f *DynamicResourceClient) Get(ctx context.Context, name string, options v1.GetOptions, subresources ...string, ) (*unstructured.Unstructured, error)
func (*DynamicResourceClient) Update ¶
func (f *DynamicResourceClient) Update(ctx context.Context, obj *unstructured.Unstructured, options v1.UpdateOptions, subresources ...string, ) (*unstructured.Unstructured, error)
func (*DynamicResourceClient) VerifyNoCreate ¶
func (f *DynamicResourceClient) VerifyNoCreate(name string)
func (*DynamicResourceClient) VerifyNoDelete ¶
func (f *DynamicResourceClient) VerifyNoDelete(name string)
func (*DynamicResourceClient) VerifyNoUpdate ¶
func (f *DynamicResourceClient) VerifyNoUpdate(name string)
type FailOnActionReactor ¶
type FailOnActionReactor struct {
// contains filtered or unexported fields
}
func FailOnAction ¶
func (*FailOnActionReactor) Fail ¶
func (r *FailOnActionReactor) Fail(v bool)
type FailingReactor ¶
type FailingReactor struct {
// contains filtered or unexported fields
}
func NewFailingReactor ¶
func NewFailingReactor(f *testing.Fake) *FailingReactor
func NewFailingReactorForResource ¶
func NewFailingReactorForResource(f *testing.Fake, resource string) *FailingReactor
func (*FailingReactor) SetFailOnCreate ¶
func (f *FailingReactor) SetFailOnCreate(err error)
func (*FailingReactor) SetFailOnDelete ¶
func (f *FailingReactor) SetFailOnDelete(err error)
func (*FailingReactor) SetFailOnGet ¶
func (f *FailingReactor) SetFailOnGet(err error)
func (*FailingReactor) SetFailOnList ¶
func (f *FailingReactor) SetFailOnList(err error)
func (*FailingReactor) SetFailOnUpdate ¶
func (f *FailingReactor) SetFailOnUpdate(err error)
func (*FailingReactor) SetResetOnFailure ¶
func (f *FailingReactor) SetResetOnFailure(v bool)
type ReactingClient ¶
func NewReactingClient ¶
func NewReactingClient(c client.Client) *ReactingClient
func (*ReactingClient) AddReactor ¶
func (c *ReactingClient) AddReactor(verb VerbType, objType interface{}, r ReactionFunc) *ReactingClient
func (*ReactingClient) Create ¶
func (c *ReactingClient) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error
func (*ReactingClient) Delete ¶
func (c *ReactingClient) Delete(ctx context.Context, obj client.Object, opts ...client.DeleteOption) error
func (*ReactingClient) List ¶
func (c *ReactingClient) List(ctx context.Context, list client.ObjectList, opts ...client.ListOption) error
func (*ReactingClient) Update ¶
func (c *ReactingClient) Update(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error
type ReactionFunc ¶
type WatchReactor ¶
type WatchReactor struct {
// contains filtered or unexported fields
}
func NewWatchReactor ¶
func NewWatchReactor(f *testing.Fake) *WatchReactor
func (*WatchReactor) AwaitNoWatchStarted ¶
func (r *WatchReactor) AwaitNoWatchStarted(forResource string)
func (*WatchReactor) AwaitNoWatchStopped ¶
func (r *WatchReactor) AwaitNoWatchStopped(forResource string)
func (*WatchReactor) AwaitWatchStarted ¶
func (r *WatchReactor) AwaitWatchStarted(forResource string)
func (*WatchReactor) AwaitWatchStopped ¶
func (r *WatchReactor) AwaitWatchStopped(forResource string)
Click to show internal directories.
Click to hide internal directories.