Documentation ¶
Index ¶
- func ExpectEvent(recorder *record.FakeRecorder, reason string)
- func ExpectEvents(recorder *record.FakeRecorder, reasons ...string)
- func HaveBodyEqualTo(expected interface{}) types.GomegaMatcher
- func HaveStatusCode(expected interface{}) types.GomegaMatcher
- func NewFakeInformerFor(obj runtime.Object) (cache.SharedIndexInformer, *framework.FakeControllerSource)
- func RepresentMimeType(expected interface{}) types.GomegaMatcher
- type DomainFeeder
- type MockWorkQueue
- type PodFeeder
- type VirtualMachineFeeder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpectEvent ¶ added in v0.0.4
func ExpectEvent(recorder *record.FakeRecorder, reason string)
func ExpectEvents ¶ added in v0.0.4
func ExpectEvents(recorder *record.FakeRecorder, reasons ...string)
ExpectEvents checks for given reasons in arbitrary order
func HaveBodyEqualTo ¶
func HaveBodyEqualTo(expected interface{}) types.GomegaMatcher
func HaveStatusCode ¶
func HaveStatusCode(expected interface{}) types.GomegaMatcher
func NewFakeInformerFor ¶ added in v0.0.4
func NewFakeInformerFor(obj runtime.Object) (cache.SharedIndexInformer, *framework.FakeControllerSource)
func RepresentMimeType ¶
func RepresentMimeType(expected interface{}) types.GomegaMatcher
Types ¶
type DomainFeeder ¶ added in v0.0.4
type DomainFeeder struct { MockQueue *MockWorkQueue Source *framework.FakeControllerSource }
func NewDomainFeeder ¶ added in v0.0.4
func NewDomainFeeder(queue *MockWorkQueue, source *framework.FakeControllerSource) *DomainFeeder
func (*DomainFeeder) Add ¶ added in v0.0.4
func (v *DomainFeeder) Add(vmi *api.Domain)
func (*DomainFeeder) Delete ¶ added in v0.0.4
func (v *DomainFeeder) Delete(vmi *api.Domain)
func (*DomainFeeder) Modify ¶ added in v0.0.4
func (v *DomainFeeder) Modify(vmi *api.Domain)
type MockWorkQueue ¶ added in v0.0.4
type MockWorkQueue struct { workqueue.RateLimitingInterface // contains filtered or unexported fields }
MockWorkQueue is a helper workqueue which can be wrapped around any RateLimitingInterface implementing queue. This allows synchronous testing of the controller. The typical pattern is:
MockQueue.ExpectAdd(3) vmiSource.Add(vmi) vmiSource.Add(vmi1) vmiSource.Add(vmi2) MockQueue.Wait()
This ensures that Source callbacks which are listening on vmiSource enqueued three times an object. Since enqueing is typically the last action in listener callbacks, we can assume that the wanted scenario for a controller is set up, and an execution will process this scenario.
func NewMockWorkQueue ¶ added in v0.0.4
func NewMockWorkQueue(queue workqueue.RateLimitingInterface) *MockWorkQueue
func (*MockWorkQueue) Add ¶ added in v0.0.4
func (q *MockWorkQueue) Add(obj interface{})
func (*MockWorkQueue) ExpectAdds ¶ added in v0.0.4
func (q *MockWorkQueue) ExpectAdds(diff int)
ExpectAdds allows setting the amount of expected enqueues.
func (*MockWorkQueue) Wait ¶ added in v0.0.4
func (q *MockWorkQueue) Wait()
Wait waits until the expected amount of ExpectedAdds has happened. It will not block if there were no expectations set.
type PodFeeder ¶ added in v0.5.0
type PodFeeder struct { MockQueue *MockWorkQueue Source *framework.FakeControllerSource }
func NewPodFeeder ¶ added in v0.5.0
func NewPodFeeder(queue *MockWorkQueue, source *framework.FakeControllerSource) *PodFeeder
type VirtualMachineFeeder ¶ added in v0.0.4
type VirtualMachineFeeder struct { MockQueue *MockWorkQueue Source *framework.FakeControllerSource }
func NewVirtualMachineFeeder ¶ added in v0.0.4
func NewVirtualMachineFeeder(queue *MockWorkQueue, source *framework.FakeControllerSource) *VirtualMachineFeeder
func (*VirtualMachineFeeder) Add ¶ added in v0.0.4
func (v *VirtualMachineFeeder) Add(vmi *v1.VirtualMachineInstance)
func (*VirtualMachineFeeder) Delete ¶ added in v0.0.4
func (v *VirtualMachineFeeder) Delete(vmi *v1.VirtualMachineInstance)
func (*VirtualMachineFeeder) Modify ¶ added in v0.0.4
func (v *VirtualMachineFeeder) Modify(vmi *v1.VirtualMachineInstance)