Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultWaitTimeout is the timeout that is used for wait operations // if it is not overridden in the ResourceOptions for a given UID. DefaultWaitTimeout = 2 * time.Hour // DefaultOptions are used for wait operations that do not set Options in a // request. DefaultOptions = Options{Timeout: DefaultWaitTimeout} )
Functions ¶
This section is empty.
Types ¶
type CompletionWait ¶
func (CompletionWait) ConditionFunc ¶
ConditionFunc waits on a job to complete. It will also watch the failed status of the job and stops waiting with an error if the job failed.
type ConditionFunc ¶
ConditionFunc is called for every resource that is waited for. It should check if the waiting condition is met or not, and if errors occured while waiting.
func NewCompletionConditionFunc ¶
func NewCompletionConditionFunc(client dynamic.Interface, errOut io.Writer) ConditionFunc
func NewDeletedConditionFunc ¶
type DeletionWait ¶
type DeletionWait struct { DynamicClient dynamic.Interface ErrOut io.Writer // UID is a map of resource locations to UIDs which can help in identifying // objects while waiting. UIDMap UIDMap }
func (DeletionWait) ConditionFunc ¶
ConditionFunc waits for something to be deleted.
type FakeWaiter ¶
func NewFakeWaiter ¶
func NewFakeWaiter() *FakeWaiter
func (*FakeWaiter) Wait ¶
func (d *FakeWaiter) Wait(r *Request) error
type Options ¶
type Options struct { // Timeout is the timeout after which to stop waiting and return an error // if the waiting condition was not met yet. Timeout time.Duration // AllowFailure indicates if an error during waiting for this resource is // acceptable. In this case the error will just be logged. AllowFailure bool }
Options are wait options for a single resource.
type Request ¶
type Request struct { // Options are options for waiting on resource conditions to meet. If nil, // DefaultOptions will be used. Options *Options // ResourceOptions is a map with Resource UIDs as keys. This allows // fine-grained configuration of per-resource wait options. This is // optional. ResourceOptions ResourceOptions // ConditionFn is used to determine when waiting should be stopped. ConditionFn ConditionFunc // Visitor will be used to walk the resources that should be waited on. Visitor resource.Visitor }
Request is a request to wait for multiple resources.
type ResourceLocation ¶
type ResourceLocation struct { GroupResource schema.GroupResource Namespace string Name string }
ResourceLocation holds the location of a resource.
type ResourceOptions ¶
ResourceOptions defines custom wait options for resource UIDs.
type StatusFailedError ¶
type StatusFailedError struct { Name string GroupVersionKind schema.GroupVersionKind }
StatusFailedError is used when a job transitioned into status failed. This is usually an error that might be acceptable and can be handled.
type WaitSkippedError ¶
type WaitSkippedError struct { Name string GroupVersionKind schema.GroupVersionKind }
type WaitTimeoutError ¶
func (WaitTimeoutError) Error ¶
func (e WaitTimeoutError) Error() string
type Waiter ¶
type Waiter interface { // Wait waits for all resources using the provided options. If no condition // func is defined in the options the default condition to wait for is // resource deletion. Wait(r *Request) error }
Waiter waits for a condition to meet.
func NewSilentWaiter ¶ added in v0.0.2
func NewSilentWaiter(streams genericclioptions.IOStreams) Waiter
NewSilentWaiter creates a new Waiter which discards all wait output.
func NewWaiter ¶
func NewWaiter(streams genericclioptions.IOStreams, p printers.ResourcePrinter) Waiter
NewWaiter creates a new Waiter value.