wait

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2019 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTestServiceWithConditions

func CreateTestServiceWithConditions(name string, readyStatus corev1.ConditionStatus, otherReadyStatus corev1.ConditionStatus, reason string, message string, generations ...int64) runtime.Object

Create a service skeleton with a given ConditionReady status and all other statuses set to otherReadyStatus. Optionally a single generation can be added.

Types

type ConditionsExtractor

type ConditionsExtractor func(obj runtime.Object) (apis.Conditions, error)

Extract conditions from a runtime object

type FakeWatch

type FakeWatch struct {

	// Record how often stop was called
	StopCalled int
	// contains filtered or unexported fields
}

Helper for testing watch functionality

func NewFakeWatch

func NewFakeWatch(events []watch.Event) *FakeWatch

Create a new fake watch with the given events which will be send when on start

func (*FakeWatch) ResultChan

func (f *FakeWatch) ResultChan() <-chan watch.Event

Channel for getting the events

func (*FakeWatch) Start

func (f *FakeWatch) Start()

Start and fire events

func (*FakeWatch) Stop

func (f *FakeWatch) Stop()

Stop the watch challend

type MessageCallback

type MessageCallback func(durationSinceState time.Duration, message string)

Callback for event messages

func NoopMessageCallback

func NoopMessageCallback() MessageCallback

Noop-callback

func SimpleMessageCallback

func SimpleMessageCallback(out io.Writer) MessageCallback

A simple message callback which prints out messages line by line

type WaitForReady

type WaitForReady interface {

	// Wait on resource the resource with this name until a given timeout
	// and write event messages for unknown event to the status writer
	Wait(name string, timeout time.Duration, msgCallback MessageCallback) (error, time.Duration)
}

Interface used for waiting of a resource of a given name to reach a definitive state in its "Ready" condition.

func NewWaitForReady

func NewWaitForReady(kind string, watchFunc WatchFunc, extractor ConditionsExtractor) WaitForReady

Constructor with resource type specific configuration

type WatchFunc

type WatchFunc func(opts v1.ListOptions) (watch.Interface, error)

Create watch which is used when waiting for Ready condition

Jump to

Keyboard shortcuts

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