fakeclient

package
v0.0.0-...-c6b2859 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2018 License: Apache-2.0, BSD-3-Clause, MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeObjectTracker

type FakeObjectTracker struct {
	*watch.FakeWatcher
	// contains filtered or unexported fields
}

FakeObjectTracker implements both k8stesting.ObjectTracker as well as watch.Interface.

func NewCoreClientSet

func NewCoreClientSet(objects ...runtime.Object) (*k8sfake.Clientset, *FakeObjectTracker)

NewCoreClientSet returns a clientset that will respond with the provided objects. It's backed by a very simple object tracker that processes creates, updates and deletions as-is, without applying any validations and/or defaults. It shouldn't be considered a replacement for a real clientset and is mostly useful in simple unit tests.

func NewMachineClientSet

func NewMachineClientSet(objects ...runtime.Object) (*fakeuntyped.Clientset, *FakeObjectTracker)

NewMachineClientSet returns a clientset that will respond with the provided objects. It's backed by a very simple object tracker that processes creates, updates and deletions as-is, without applying any validations and/or defaults. It shouldn't be considered a replacement for a real clientset and is mostly useful in simple unit tests.

func (*FakeObjectTracker) Add

func (t *FakeObjectTracker) Add(obj runtime.Object) error

Add recieves an add event with the object

func (*FakeObjectTracker) ClearOptions

func (o *FakeObjectTracker) ClearOptions(message string) error

ClearOptions clears any faking options that have been sets

func (*FakeObjectTracker) Create

Create recieves an create event with the object

func (*FakeObjectTracker) Delete

func (t *FakeObjectTracker) Delete(gvr schema.GroupVersionResource, ns, name string) error

Delete recieves an delete event with the object

func (*FakeObjectTracker) Get

Get recieves an get event with the object

func (*FakeObjectTracker) List

List recieves an list event with the object

func (*FakeObjectTracker) RunFakeInvocations

func (o *FakeObjectTracker) RunFakeInvocations() error

RunFakeInvocations runs any custom fake configurations/methods before invoking standard ObjectTrackers

func (*FakeObjectTracker) SetDelay

func (o *FakeObjectTracker) SetDelay(delay time.Duration) error

SetDelay sets delay while invoking any interface exposed by standard ObjectTrackers

func (*FakeObjectTracker) SetError

func (o *FakeObjectTracker) SetError(message string) error

SetError sets up the errorMessage to be returned on further function calls

func (*FakeObjectTracker) Start

func (t *FakeObjectTracker) Start() error

Start begins tracking of an FakeObjectTracker

func (*FakeObjectTracker) Stop

func (t *FakeObjectTracker) Stop()

Stop terminates tracking of an FakeObjectTracker

func (*FakeObjectTracker) Update

Update recieves an update event with the object

func (*FakeObjectTracker) Watch

Watch recieves an watch event with the object

type FakeObjectTrackers

type FakeObjectTrackers struct {
	ControlMachine, ControlCore, TargetCore *FakeObjectTracker
}

FakeObjectTrackers is a struct containing all the controller fake object trackers

func NewFakeObjectTrackers

func NewFakeObjectTrackers(controlMachine, controlCore, targetCore *FakeObjectTracker) *FakeObjectTrackers

NewFakeObjectTrackers initialize's fakeObjectTrackers initializes the fake object trackers

func (*FakeObjectTrackers) Start

func (o *FakeObjectTrackers) Start() error

Start starts all object trackers as go routines

func (*FakeObjectTrackers) Stop

func (o *FakeObjectTrackers) Stop() error

Stop stops all object trackers

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL