states

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Condition

type Condition func(s metav1.Object) Result

Condition is a function that checks a state and returns a Result.

type Result

type Result struct {
	Ok          bool            // True if the Condition is true, false otherwise.
	Description string          // A human-readable description of the associated Condition.
	Message     logging.Message // The message to be logged after evaluating the Condition.
}

Result specifies the result of a Condition applied to an input object.

func (Result) String

func (r Result) String() string

type StateChecker

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

StateChecker holds the data required to generically implement await logic.

func NewJobChecker

func NewJobChecker() *StateChecker

func NewPodChecker

func NewPodChecker() *StateChecker

func (*StateChecker) Ready

func (s *StateChecker) Ready() bool

Ready is true if all of the Conditions associated with this checker are true. Ready will always return false prior to running Update.

func (*StateChecker) Update

func (s *StateChecker) Update(obj metav1.Object) logging.Messages

Update runs the conditions associated with the StateChecker against the provided object. Each condition produces a status message that is appended to the returned list of Messages. Iff all of the Conditions are true, the ready status is set to true, otherwise, the ready condition is set to false.

Jump to

Keyboard shortcuts

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