conditions

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServerError              = "ServerError"
	TargetClusterClientError = "TargetClusterClientError"

	CreateReleaseFailed                 = "CreateReleaseFailed"
	ChartVersionResolutionFailed        = "ChartVersionResolutionFailed"
	BrokenReleaseGeneration             = "BrokenReleaseGeneration"
	BrokenApplicationObservedGeneration = "BrokenApplicationObservedGeneration"
	StrategyExecutionFailed             = "StrategyExecutionFailed"
)

Variables

View Source
var StrategyConditionsShouldDiscardTimestamps = false

StrategyConditionsShouldDiscardTimestamps can be used to skip timestamps in condition transitions in tests.

Functions

func CondStr

func CondStr(ci interface{}) string

Types

type StrategyConditionsMap

StrategyConditionsMap is used to manage a list of ReleaseStrategyConditions.

func NewStrategyConditions

func NewStrategyConditions(conditions ...shipper.ReleaseStrategyCondition) StrategyConditionsMap

NewStrategyConditions returns a new StrategyConditionsMap object with the given list of ReleaseStrategyConditions.

func (StrategyConditionsMap) AllTrue

func (sc StrategyConditionsMap) AllTrue(step int32) bool

AllTrue returns true if all the existing conditions in the receiver have their status True.

func (StrategyConditionsMap) AsReleaseStrategyConditions

func (sc StrategyConditionsMap) AsReleaseStrategyConditions() []shipper.ReleaseStrategyCondition

AsReleaseStrategyConditions returns an ordered list of v1.ReleaseStrategyCondition values. This list is sorted by ReleaseStrategyCondition type.

func (StrategyConditionsMap) AsReleaseStrategyState

func (sc StrategyConditionsMap) AsReleaseStrategyState(
	step int32,
	hasIncumbent bool,
	isLastStep bool,
	isHead bool,
) shipper.ReleaseStrategyState

AsReleaseStrategyState returns a ReleaseStrategyState computed from the conditions in the receiver.

func (StrategyConditionsMap) GetCondition

func (StrategyConditionsMap) GetStatus

GetStatus returns the status of condition from the receiver.

func (StrategyConditionsMap) IsFalse

func (sc StrategyConditionsMap) IsFalse(step int32, conditionTypes ...shipper.StrategyConditionType) bool

IsFalse returns true if all the given conditions have their status False in the receiver.

func (StrategyConditionsMap) IsNotTrue

func (sc StrategyConditionsMap) IsNotTrue(step int32, conditionTypes ...shipper.StrategyConditionType) bool

func (StrategyConditionsMap) IsTrue

func (sc StrategyConditionsMap) IsTrue(step int32, conditionTypes ...shipper.StrategyConditionType) bool

IsTrue returns true if all the given conditions have their status True in the receiver.

func (StrategyConditionsMap) IsUnknown

func (sc StrategyConditionsMap) IsUnknown(step int32, conditionTypes ...shipper.StrategyConditionType) bool

IsUnknown returns true if all the given conditions have their status Unknown in the receiver.

func (StrategyConditionsMap) Merge

Merge merges another StrategyConditionsMap object into the receiver. Conditions from "other" can override existing conditions in the receiver.

func (StrategyConditionsMap) Set

Set adds conditions to the receiver. Added conditions can override existing conditions in the receiver.

func (StrategyConditionsMap) SetFalse

SetFalse transitions an existing condition from its current status to False.

func (StrategyConditionsMap) SetTrue

SetTrue transitions an existing condition from its current status to True.

func (StrategyConditionsMap) SetUnknown

func (sc StrategyConditionsMap) SetUnknown(conditionType shipper.StrategyConditionType, update StrategyConditionsUpdate)

SetUnknown transitions an existing condition from its current status to Unknown.

type StrategyConditionsUpdate

type StrategyConditionsUpdate struct {
	Reason             string
	Message            string
	Step               int32
	LastTransitionTime time.Time
}

Jump to

Keyboard shortcuts

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