wait

package
v1.6.6 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2022 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Package wait implements node waiter.

Index

Constants

View Source
const ManagedNodeGroupStatusDELETEDORNOTEXIST = "DELETED/NOT-EXIST"

ManagedNodeGroupStatusDELETEDORNOTEXIST defines the cluster status when the cluster is not found.

ref. https://docs.aws.amazon.com/eks/latest/APIReference/API_Nodegroup.html

CREATING
ACTIVE
DELETING
FAILED
UPDATING

Variables

This section is empty.

Functions

func IsDeleted

func IsDeleted(err error) bool

IsDeleted returns true if error from EKS API indicates that the EKS managed node group has already been deleted.

func Poll

func Poll(
	ctx context.Context,
	stopc chan struct{},
	lg *zap.Logger,
	logWriter io.Writer,
	eksAPI eksiface.EKSAPI,
	clusterName string,
	mngName string,
	desiredNodeGroupStatus string,
	initialWait time.Duration,
	pollInterval time.Duration,
	opts ...OpOption) <-chan ManagedNodeGroupStatus

Poll periodically fetches the managed node group status until the node group becomes the desired state.

func PollUpdate added in v1.4.6

func PollUpdate(
	ctx context.Context,
	stopc chan struct{},
	lg *zap.Logger,
	logWriter io.Writer,
	eksAPI eksiface.EKSAPI,
	clusterName string,
	mngName string,
	requestID string,
	desiredUpdateStatus string,
	initialWait time.Duration,
	pollInterval time.Duration,
	opts ...OpOption) <-chan UpdateStatus

PollUpdate periodically fetches the MNG update status until the MNG update becomes the desired state. ref. https://docs.aws.amazon.com/eks/latest/APIReference/API_DescribeUpdate.html

Types

type Config

type Config struct {
	Logger    *zap.Logger
	LogWriter io.Writer
	Stopc     chan struct{}
	EKSConfig *eksconfig.Config
	K8SClient k8s_client.EKS

	EC2APIV2 *aws_ec2_v2.Client
	ASGAPIV2 *aws_asg_v2.Client
	EKSAPI   eksiface.EKSAPI
}

Config defines version upgrade configuration.

type ManagedNodeGroupStatus

type ManagedNodeGroupStatus struct {
	NodeGroupName string
	NodeGroup     *aws_eks.Nodegroup
	Error         error
}

ManagedNodeGroupStatus represents the CloudFormation status.

type NodeWaiter

type NodeWaiter interface {
	// Wait waits until all MNG and Kubernetes nodes are ready.
	Wait(mngName string, retries int) error
}

NodeWaiter defines node waiter operation.

func New

func New(cfg Config) NodeWaiter

New creates a new node waiter.

type Op added in v1.4.6

type Op struct {
	// contains filtered or unexported fields
}

Op represents a MNG operation.

type OpOption added in v1.4.6

type OpOption func(*Op)

OpOption configures archiver operations.

func WithQueryFunc added in v1.4.6

func WithQueryFunc(f func()) OpOption

WithQueryFunc configures query function to be called in retry func.

type UpdateStatus added in v1.4.6

type UpdateStatus struct {
	Update *eks.Update
	Error  error
}

UpdateStatus represents the CloudFormation status.

Jump to

Keyboard shortcuts

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