conditions

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FailedRSCreateReason is added in a rollout when it cannot create a new replica set.
	FailedRSCreateReason = "ReplicaSetCreateError"

	// InvalidSpecReason indicates that the spec is invalid
	InvalidSpecReason = "InvalidSpec"
	// MissingFieldMessage the message to indicate rollout is missing a field
	MissingFieldMessage = "Rollout has missing field '%s'"
	// SelectAllMessage the message to indicate that the rollout has an empty selector
	SelectAllMessage = "This rollout is selecting all pods. A non-empty selector is required."
	// InvalidSetWeightMessage indicates the setweight value needs to be between 0 and 100
	InvalidSetWeightMessage = "SetWeight needs to be between 0 and 100"
	// InvalidDurationMessage indicates the Duration value needs to be greater than 0
	InvalidDurationMessage = "Duration needs to be greater than 0"
	// InvalidMaxSurgeMaxUnavailable indicates both maxSurge and MaxUnavailable can not be set to zero
	InvalidMaxSurgeMaxUnavailable = "MaxSurge and MaxUnavailable both can not be zero"
	// InvalidStepMessage indicates that a step must have either setWeight or pause set
	InvalidStepMessage = "Step must have either setWeight or pause set"
	// InvalidStrategyMessage indiciates that multiple strategies can not be listed
	InvalidStrategyMessage = "Multiple Strategies can not be listed"
	// DuplicatedServicesMessage the message to indicate that the rollout uses the same service for the active and preview services
	DuplicatedServicesMessage = "This rollout uses the same service for the active and preview services, but two different services are required."
	// Available the reason to indicate that the rollout is serving traffic from the active service
	Available = "Available"
)

Variables

This section is empty.

Functions

func ComputeGenerationHash

func ComputeGenerationHash(spec v1alpha1.RolloutSpec) string

ComputeGenerationHash returns a hash value calculated from the Rollout Spec. The hash will be safe encoded to avoid bad words.

func ComputeStepHash added in v0.2.0

func ComputeStepHash(rollout *v1alpha1.Rollout) string

ComputeStepHash returns a hash value calculated from the Rollout's steps. The hash will be safe encoded to avoid bad words.

func GetRolloutCondition

func GetRolloutCondition(status v1alpha1.RolloutStatus, condType v1alpha1.RolloutConditionType) *v1alpha1.RolloutCondition

GetRolloutCondition returns the condition with the provided type.

func HasRevisionHistoryLimit

func HasRevisionHistoryLimit(r *v1alpha1.Rollout) bool

HasRevisionHistoryLimit checks if the RevisionHistoryLimit field is set

func NewRolloutCondition

func NewRolloutCondition(condType v1alpha1.RolloutConditionType, status corev1.ConditionStatus, reason, message string) *v1alpha1.RolloutCondition

NewRolloutCondition creates a new rollout condition.

func RemoveRolloutCondition

func RemoveRolloutCondition(status *v1alpha1.RolloutStatus, condType v1alpha1.RolloutConditionType)

RemoveRolloutCondition removes the rollout condition with the provided type.

func RolloutComplete

func RolloutComplete(rollout *v1alpha1.Rollout, newStatus *v1alpha1.RolloutStatus) bool

RolloutComplete considers a rollout to be complete once all of its desired replicas are updated, available, and receiving traffic from the active service, and no old pods are running.

func SetRolloutCondition

func SetRolloutCondition(status *v1alpha1.RolloutStatus, condition v1alpha1.RolloutCondition)

SetRolloutCondition updates the rollout to include the provided condition. If the condition that we are about to add already exists and has the same status and reason then we are not going to update.

func VerifyRolloutSpec

func VerifyRolloutSpec(rollout *v1alpha1.Rollout, prevCond *v1alpha1.RolloutCondition) *v1alpha1.RolloutCondition

VerifyRolloutSpec Checks for a valid spec otherwise returns a invalidSpec condition.

Types

This section is empty.

Jump to

Keyboard shortcuts

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