Documentation ¶
Index ¶
- func CreateTestServiceWithConditions(name string, readyStatus, otherReadyStatus corev1.ConditionStatus, ...) *servingv1.Service
- func NewWatcherWithVersion(ctx context.Context, watchFunc watchF, c rest.Interface, ns 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, otherReadyStatus corev1.ConditionStatus, reason, message string, generations ...int64, ) *servingv1.Service
CreateTestServiceWithConditions create a service skeleton with a given ConditionReady status and all other statuses set to otherReadyStatus. Optionally a single generation can be added.
func NewWatcherWithVersion ¶
func NewWatcherWithVersion(ctx context.Context, watchFunc watchF, c rest.Interface, ns string, resource string, name string, initialResourceVersion string, timeout time.Duration) (watch.Interface, error)
NewWatcherWithVersion 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 ¶
PollInterval determines when you should poll. Useful to mock out, or for replacing with exponential backoff later.
type Wait ¶
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(ctx context.Context, name string, initialVersion 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 ¶
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