Documentation
¶
Index ¶
- func CreateTestServiceWithConditions(name string, readyStatus corev1.ConditionStatus, ...) runtime.Object
- func NewWatcher(watchFunc watchF, c rest.Interface, ns string, resource string, name string, ...) (watch.Interface, error)
- type ConditionsExtractor
- type EventDone
- type FakeWatch
- type MessageCallback
- type Options
- type PollInterval
- type Wait
- type WatchMaker
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.
func NewWatcher ¶ added in v0.11.0
func NewWatcher(watchFunc watchF, c rest.Interface, ns string, resource string, name string, timeout time.Duration) (watch.Interface, error)
NewWatcher makes a watch.Interface on the given resource in the client, falling back to polling if the server does not support Watch.
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 ¶
Create a new fake watch with the given events which will be send when on start
func (*FakeWatch) ResultChan ¶
Channel for getting the events
type MessageCallback ¶
Callback for event messages
func NoopMessageCallback ¶
func NoopMessageCallback() MessageCallback
NoopMessageCallback is callback which does nothing
func SimpleMessageCallback ¶
func SimpleMessageCallback(out io.Writer) MessageCallback
SimpleMessageCallback returns a callback which prints out a simple event message to a given writer
type PollInterval ¶ added in v0.11.0
PollInterval determines when you should poll. Useful to mock out, or for replacing with exponential backoff later.
type Wait ¶ added in v0.13.0
type Wait interface { // Wait on resource the resource with this name // and write event messages for unknown event to the status writer. // Returns an error (if any) and the overall time it took to wait Wait(name string, options Options, 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 NewWaitForEvent ¶ added in v0.13.0
func NewWaitForEvent(kind string, watchMaker WatchMaker, eventDone EventDone) Wait
NewWaitForEvent creates a Wait object which waits until a specific event (i.e. when the EventDone function returns true)
func NewWaitForReady ¶
func NewWaitForReady(kind string, watchMaker WatchMaker, extractor ConditionsExtractor) Wait
NewWaitForReady waits until the condition is set to Ready == True