waiter

package
v0.164.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: Apache-2.0 Imports: 11 Imported by: 3 modules, 6 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ClusterCreationNextDelay = func(attempts int) time.Duration {

	if attempts <= 2 {
		return 30 * time.Second
	}
	return 1 * time.Minute
}

Functions

func WaitForNodegroupUpdate added in v0.103.0

func WaitForNodegroupUpdate(ctx context.Context, updateID string, api awsapi.EKS, timeout time.Duration, nextDelay NextDelay) (string, error)

WaitForNodegroupUpdate waits for an update to finish. Once it's done it returns the final status. If the status was not Successful it will also return an error.

func WaitForStack

func WaitForStack(ctx context.Context, cfnAPI awsapi.CloudFormation, stackID, stackName string, nextDelay NextDelay) (*types.Stack, error)

WaitForStack waits for the cluster stack to reach a success or failure state, and returns the stack.

Types

type NextDelay

type NextDelay func(attempts int) time.Duration

NextDelay returns the amount of time to wait before the next retry given the number of attempts.

type Waiter

type Waiter struct {
	// NextDelay is the amount of time to wait before the next retry given the number of attempts.
	NextDelay NextDelay

	// Operation is the function to invoke.
	Operation func() (bool, error)
}

A Waiter keeps retrying the specified operation until it returns true, or an error.

func (*Waiter) Wait

func (w *Waiter) Wait(ctx context.Context) error

Wait waits for the specified operation to complete.

func (*Waiter) WaitWithTimeout

func (w *Waiter) WaitWithTimeout(timeout time.Duration) error

WaitWithTimeout is a wrapper around Wait that takes a timeout value instead of a Context, and returns a DeadlineExceeded error when the timeout expires. It exists to allow interfacing with code that is not using contexts yet.

Jump to

Keyboard shortcuts

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