Documentation ¶
Index ¶
- func AddFakeUpdateReactor(resource string, client *core.Fake)
- func AssertHasFinalizer(t *testing.T, obj runtime.Object, finalizer string)
- func CheckObjectFromChan(c chan runtime.Object, checkFunction CheckingFunction) error
- func CompareObjectMeta(a, b metav1.ObjectMeta) error
- func GetObjectFromChan(c chan runtime.Object) runtime.Object
- func NewCluster(name string, readyStatus apiv1.ConditionStatus) *federationapi.Cluster
- func NewInt32(val int32) *int32
- func RegisterFakeClusterGet(client *core.Fake, obj runtime.Object)
- func RegisterFakeCopyOnCreate(resource string, client *core.Fake, watcher *WatcherDispatcher) chan runtime.Object
- func RegisterFakeCopyOnUpdate(resource string, client *core.Fake, watcher *WatcherDispatcher) chan runtime.Object
- func RegisterFakeList(resource string, client *core.Fake, obj runtime.Object)
- func RegisterFakeOnCreate(resource string, client *core.Fake, watcher *WatcherDispatcher)
- func RegisterFakeOnDelete(resource string, client *core.Fake, watcher *WatcherDispatcher, ...)
- func RegisterFakeOnUpdate(resource string, client *core.Fake, watcher *WatcherDispatcher)
- func ToFederatedInformerForTestOnly(informer util.FederatedInformer) util.FederatedInformerForTestOnly
- func WaitForStoreUpdate(store util.FederatedReadOnlyStore, clusterName, key string, ...) error
- func WaitForStoreUpdateChecking(store util.FederatedReadOnlyStore, clusterName, key string, ...) error
- type CheckingFunction
- type WatcherDispatcher
- func (wd *WatcherDispatcher) Action(action watch.EventType, obj runtime.Object)
- func (wd *WatcherDispatcher) Add(obj runtime.Object)
- func (wd *WatcherDispatcher) Delete(lastValue runtime.Object)
- func (wd *WatcherDispatcher) Error(errValue runtime.Object)
- func (wd *WatcherDispatcher) Modify(obj runtime.Object)
- func (wd *WatcherDispatcher) Stop()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddFakeUpdateReactor ¶
Adds an update reactor to the given fake client. The reactor just returns the object passed to update action. This is used as a hack to workaround https://github.com/kubernetes/kubernetes/issues/40939. Without this, all update actions using fake client return empty objects.
func AssertHasFinalizer ¶
func CheckObjectFromChan ¶
func CheckObjectFromChan(c chan runtime.Object, checkFunction CheckingFunction) error
CheckObjectFromChan tries to get an object matching the given check function within a reasonable time.
func CompareObjectMeta ¶
func CompareObjectMeta(a, b metav1.ObjectMeta) error
CompareObjectMeta returns an error when the given objects are not equivalent.
func GetObjectFromChan ¶
GetObjectFromChan tries to get an api object from the given channel within a reasonable time.
func NewCluster ¶
func NewCluster(name string, readyStatus apiv1.ConditionStatus) *federationapi.Cluster
NewCluster builds a new cluster object.
func RegisterFakeClusterGet ¶
RegisterFakeClusterGet registers a get response for the cluster resource inside the given fake client.
func RegisterFakeCopyOnCreate ¶
func RegisterFakeCopyOnCreate(resource string, client *core.Fake, watcher *WatcherDispatcher) chan runtime.Object
RegisterFakeCopyOnCreate registers a reactor in the given fake client that passes all created objects to the given watcher and also copies them to a channel for in-test inspection.
func RegisterFakeCopyOnUpdate ¶
func RegisterFakeCopyOnUpdate(resource string, client *core.Fake, watcher *WatcherDispatcher) chan runtime.Object
RegisterFakeCopyOnUpdate registers a reactor in the given fake client that passes all updated objects to the given watcher and also copies them to a channel for in-test inspection.
func RegisterFakeList ¶
RegisterFakeList registers a list response for the specified resource inside the given fake client. The passed value will be returned with every list call.
func RegisterFakeOnCreate ¶
func RegisterFakeOnCreate(resource string, client *core.Fake, watcher *WatcherDispatcher)
RegisterFakeOnCreate registers a reactor in the given fake client that passes all created objects to the given watcher.
func RegisterFakeOnDelete ¶
func RegisterFakeOnDelete(resource string, client *core.Fake, watcher *WatcherDispatcher, getObject func(name, namespace string) runtime.Object)
RegisterFakeOnDelete registers a reactor in the given fake client that passes all deleted objects to the given watcher. Since we could get only name of the deleted object from DeleteAction, this register function relies on the getObject function passed to get the object by name and pass it watcher.
func RegisterFakeOnUpdate ¶
func RegisterFakeOnUpdate(resource string, client *core.Fake, watcher *WatcherDispatcher)
RegisterFakeOnUpdate registers a reactor in the given fake client that passes all updated objects to the given watcher.
func ToFederatedInformerForTestOnly ¶
func ToFederatedInformerForTestOnly(informer util.FederatedInformer) util.FederatedInformerForTestOnly
func WaitForStoreUpdate ¶
func WaitForStoreUpdate(store util.FederatedReadOnlyStore, clusterName, key string, timeout time.Duration) error
Ensure a key is in the store before returning (or timeout w/ error)
func WaitForStoreUpdateChecking ¶
func WaitForStoreUpdateChecking(store util.FederatedReadOnlyStore, clusterName, key string, timeout time.Duration, checkFunction CheckingFunction) error
Ensure a key is in the store before returning (or timeout w/ error)
Types ¶
type CheckingFunction ¶
func MetaAndSpecCheckingFunction ¶
func MetaAndSpecCheckingFunction(expected runtime.Object) CheckingFunction
type WatcherDispatcher ¶
A structure that distributes events to multiple watchers.
func RegisterFakeWatch ¶
func RegisterFakeWatch(resource string, client *core.Fake) *WatcherDispatcher
RegisterFakeWatch adds a new fake watcher for the specified resource in the given fake client. All subsequent requests for a watch on the client will result in returning this fake watcher.
func (*WatcherDispatcher) Action ¶
func (wd *WatcherDispatcher) Action(action watch.EventType, obj runtime.Object)
Action sends an event of the requested type, for table-based testing.
func (*WatcherDispatcher) Add ¶
func (wd *WatcherDispatcher) Add(obj runtime.Object)
Add sends an add event.
func (*WatcherDispatcher) Delete ¶
func (wd *WatcherDispatcher) Delete(lastValue runtime.Object)
Delete sends a delete event.
func (*WatcherDispatcher) Error ¶
func (wd *WatcherDispatcher) Error(errValue runtime.Object)
Error sends an Error event.
func (*WatcherDispatcher) Modify ¶
func (wd *WatcherDispatcher) Modify(obj runtime.Object)
Modify sends a modify event.
func (*WatcherDispatcher) Stop ¶
func (wd *WatcherDispatcher) Stop()