wait

package
v0.25.34 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2023 License: Apache-2.0 Imports: 20 Imported by: 1

README

kubectl wait

This library has been forked from https://github.com/kubernetes/kubectl/blob/v0.20.4/pkg/cmd/wait/wait.go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsDeleted

func IsDeleted(info *resource.Info, o *WaitOptions) (runtime.Object, bool, error)

IsDeleted is a condition func for waiting for something to be deleted

Types

type ConditionFunc

type ConditionFunc func(info *resource.Info, o *WaitOptions) (finalObject runtime.Object, done bool, err error)

ConditionFunc is the interface for providing condition checks

func ConditionFuncFor

func ConditionFuncFor(condition string, errOut io.Writer) (ConditionFunc, error)

type ConditionalWait

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

ConditionalWait hold information to check an API status condition

func (ConditionalWait) IsConditionMet

func (w ConditionalWait) IsConditionMet(info *resource.Info, o *WaitOptions) (runtime.Object, bool, error)

IsConditionMet is a conditionfunc for waiting on an API condition to be met

type ResourceLocation

type ResourceLocation struct {
	GroupResource schema.GroupResource
	Namespace     string
	Name          string
}

ResourceLocation holds the location of a resource

type UIDMap

type UIDMap map[ResourceLocation]types.UID

UIDMap maps ResourceLocation with UID

type Wait

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

Wait has helper methods for handling watches, including error handling.

func (Wait) IsDeleted

func (w Wait) IsDeleted(event watch.Event) (bool, error)

IsDeleted returns true if the object is deleted. It prints any errors it encounters.

type WaitOptions

type WaitOptions struct {
	ResourceFinder genericclioptions.ResourceFinder
	// UIDMap maps a resource location to a UID.  It is optional, but ConditionFuncs may choose to use it to make the result
	// more reliable.  For instance, delete can look for UID consistency during delegated calls.
	UIDMap        UIDMap
	DynamicClient dynamic.Interface
	Timeout       time.Duration

	Printer     printers.ResourcePrinter
	ConditionFn ConditionFunc
	genericclioptions.IOStreams
}

WaitOptions is a set of options that allows you to wait. This is the object reflects the runtime needs of a wait command, making the logic itself easy to unit test with our existing mocks.

func (*WaitOptions) RunWait

func (o *WaitOptions) RunWait() error

RunWait runs the waiting logic

func (*WaitOptions) WaitUntilAvailable

func (o *WaitOptions) WaitUntilAvailable(forCondition string) error

Jump to

Keyboard shortcuts

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