Documentation ¶
Overview ¶
Package k8s handles interacting with Kubernetes clusters.
Index ¶
Constants ¶
const ( ErrWaitConditionInvalidCode = 1751 ErrResourceWaitFailureCode = 1752 )
Object error codes (1751-2000)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConditionalWaiter ¶
type ConditionalWaiter struct {
// contains filtered or unexported fields
}
ConditionalWaiter stores information for executing a wait loop to ensure a specific condition is met for one or more resources.
func NewConditionalWaiter ¶
func NewConditionalWaiter(resource *dynamicResource, waitCondition WaitCondition, waitGroup *sync.WaitGroup) *ConditionalWaiter
NewConditionalWaiter creates and initializes a new ConditionalWaiter object.
func (*ConditionalWaiter) Error ¶
func (w *ConditionalWaiter) Error() error
Error returns the error associated with the object.
func (*ConditionalWaiter) Run ¶
func (w *ConditionalWaiter) Run(ctx context.Context)
Run executes a loop waiting for the given condition to be true for all matching resources.
Any errors that occur while the waiter is running can be retrieved by calling the waiter's Error() function.
The following errors are possible with this function: ErrResourceWaitFailure
type ErrResourceWaitFailure ¶
ErrResourceWaitFailure occurs when an error occurs while waiting for a resource.
func (*ErrResourceWaitFailure) Code ¶
func (e *ErrResourceWaitFailure) Code() int
Code returns the corresponding error code.
func (*ErrResourceWaitFailure) Error ¶
func (e *ErrResourceWaitFailure) Error() string
Error returns the string version of the error.
func (*ErrResourceWaitFailure) InternalError ¶
func (e *ErrResourceWaitFailure) InternalError() error
InternalError returns the internal standard error object if there is one or nil if none is set.
type ErrWaitConditionInvalid ¶
type ErrWaitConditionInvalid struct {
Err error
}
ErrWaitConditionInvalid occurs when a wait condition is invalid.
func (*ErrWaitConditionInvalid) Code ¶
func (e *ErrWaitConditionInvalid) Code() int
Code returns the corresponding error code.
func (*ErrWaitConditionInvalid) Error ¶
func (e *ErrWaitConditionInvalid) Error() string
Error returns the string version of the error.
func (*ErrWaitConditionInvalid) InternalError ¶
func (e *ErrWaitConditionInvalid) InternalError() error
InternalError returns the internal standard error object if there is one or nil if none is set.
type WaitCondition ¶
type WaitCondition struct { Condition string `yaml:"condition"` RawResource map[string]interface{} `yaml:"resource"` Selectors []string `yaml:"selectors"` Timeout uint `yaml:"timeout"` ResourceDefinition []byte }
WaitCondition holds information on what resources we must wait on before continuing.
func (*WaitCondition) UnmarshalYAML ¶
func (c *WaitCondition) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML handles parsing YAML into an object and setting sensible defaults.
The following errors are returned by this function: ErrWaitConditionInvalid