conditions

package
v0.0.7-rc.5 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConditionManager

type ConditionManager interface {
	// Add a condition and associate a polarity with it.
	Add(condition metav1.Condition, positive Polarity)

	// AddPositive Adds a condition with a positive polarity
	AddPositive(condition metav1.Condition)

	// AddNegative Adds a condition with a negative polarity
	AddNegative(condition metav1.Condition)

	// Finalize	returns all conditions
	// not idempotent! subsequent finalizes will keep adding Parent conditions
	// The changed result represents whether the conditions have changed enough to warrant an update to the APIServer
	Finalize() (conditions []metav1.Condition, changed bool)

	// IsSuccessful can be called any time. Start's off true, but an
	// add of an unsuccessful condition (Positive-False or Negative-True)
	// causes this to return false
	IsSuccessful() bool
}

ConditionManager supports collecting condition statuses for your controller It adds a complete top level condition when Finalize is called.

TBD: either error or warn if the same Condition.Type is reused TBD2: should accept an existing []Condition slice to compare against

should only update LastTransitionTime if the other fields have changed

func NewConditionManager

func NewConditionManager(topLevelType string, previousConditions []metav1.Condition) ConditionManager

NewConditionManager returns a ConditionManager with a top level Condition.Type specified in topLevelType

type ConditionManagerBuilder

type ConditionManagerBuilder func(topLevelType string, previousConditions []metav1.Condition) ConditionManager

type Polarity

type Polarity string

Polarity represents how a Status is represented as success.

const Negative Polarity = "Negative"

Negative Polarity means a "False" ConditionStatus is a success

const Positive Polarity = "Positive"

Positive Polarity means a "True" ConditionStatus is a success

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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