kubernetes: k8s.io/kubernetes/pkg/kubectl/cmd/wait Index | Files

package wait

import "k8s.io/kubernetes/pkg/kubectl/cmd/wait"


Package Files


func IsDeleted Uses

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

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

func NewCmdWait Uses

func NewCmdWait(restClientGetter genericclioptions.RESTClientGetter, streams genericclioptions.IOStreams) *cobra.Command

NewCmdWait returns a cobra command for waiting

type ConditionFunc Uses

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

ConditionFunc is the interface for providing condition checks

type ConditionalWait Uses

type ConditionalWait struct {
    // contains filtered or unexported fields

ConditionalWait hold information to check an API status condition

func (ConditionalWait) IsConditionMet Uses

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 Uses

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

ResourceLocation holds the location of a resource

type UIDMap Uses

type UIDMap map[ResourceLocation]types.UID

UIDMap maps ResourceLocation with UID

type Wait Uses

type Wait struct {
    // contains filtered or unexported fields

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

func (Wait) IsDeleted Uses

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

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

type WaitFlags Uses

type WaitFlags struct {
    RESTClientGetter     genericclioptions.RESTClientGetter
    PrintFlags           *genericclioptions.PrintFlags
    ResourceBuilderFlags *genericclioptions.ResourceBuilderFlags

    Timeout      time.Duration
    ForCondition string


WaitFlags directly reflect the information that CLI is gathering via flags. They will be converted to Options, which reflect the runtime requirements for the command. This structure reduces the transformation to wiring and makes the logic itself easy to unit test

func NewWaitFlags Uses

func NewWaitFlags(restClientGetter genericclioptions.RESTClientGetter, streams genericclioptions.IOStreams) *WaitFlags

NewWaitFlags returns a default WaitFlags

func (*WaitFlags) AddFlags Uses

func (flags *WaitFlags) AddFlags(cmd *cobra.Command)

AddFlags registers flags for a cli

func (*WaitFlags) ToOptions Uses

func (flags *WaitFlags) ToOptions(args []string) (*WaitOptions, error)

ToOptions converts from CLI inputs to runtime inputs

type WaitOptions Uses

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

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 Uses

func (o *WaitOptions) RunWait() error

RunWait runs the waiting logic

Package wait imports 23 packages (graph) and is imported by 20 packages. Updated 2019-07-10. Refresh now. Tools for package owners.