conditions

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 1, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// 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"
	// ScaleDownDelayLongerThanDeadlineMessage indicates the ScaleDownDelaySeconds is longer than ProgressDeadlineSeconds
	ScaleDownDelayLongerThanDeadlineMessage = "ScaleDownDelaySeconds cannot be longer than ProgressDeadlineSeconds"
	// MinReadyLongerThanDeadlineMessage indicates the MinReadySeconds is longer than ProgressDeadlineSeconds
	MinReadyLongerThanDeadlineMessage = "MinReadySeconds cannot be longer than ProgressDeadlineSeconds"
	// 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."
	// AvailableReason the reason to indicate that the rollout is serving traffic from the active service
	AvailableReason = "AvailableReason"
	// NotAvailableMessage the message to indicate that the Rollout does not have min availability
	NotAvailableMessage = "Rollout does not have minimum availability"
	// AvailableMessage the message to indicate that the Rollout does have min availability
	AvailableMessage = "Rollout has minimum availability"

	// ReplicaSetUpdatedReason is added in a rollout when one of its replica sets is updated as part
	// of the rollout process.
	ReplicaSetUpdatedReason = "ReplicaSetUpdated"
	// RolloutProgessingMessage is added in a rollout when one of its replica sets is updated as part
	// of the rollout process.
	RolloutProgressingMessage = "Rollout %q is progressing."
	// ReplicaSetProgessingMessage is added in a rollout when one of its replica sets is updated as part
	// of the rollout process.
	ReplicaSetProgressingMessage = "ReplicaSet %q is progressing."
	// FailedRSCreateReason is added in a rollout when it cannot create a new replica set.
	FailedRSCreateReason = "ReplicaSetCreateError"
	// FailedRSCreateMessage is added in a rollout when it cannot create a new replica set.
	FailedRSCreateMessage = "Failed to create new replica set %q: %v"

	// NewReplicaSetReason is added in a rollout when it creates a new replica set.
	NewReplicaSetReason = "NewReplicaSetCreated"
	//NewReplicasSetMessage is added in a rollout when it creates a new replicas \set.
	NewReplicaSetMessage = "Created new replica set %q"
	// FoundNewRSReason is added in a rollout when it adopts an existing replica set.
	FoundNewRSReason = "FoundNewReplicaSet"
	// FoundNewRSMessage is added in a rollout when it adopts an existing replica set.
	FoundNewRSMessage = "Found new replica set %q"

	// NewRSAvailableReason is added in a rollout when its newest replica set is made available
	// ie. the number of new pods that have passed readiness checks and run for at least minReadySeconds
	// is at least the minimum available pods that need to run for the rollout.
	NewRSAvailableReason = "NewReplicaSetAvailable"

	// TimedOutReason is added in a rollout when its newest replica set fails to show any progress
	// within the given deadline (progressDeadlineSeconds).
	TimedOutReason = "ProgressDeadlineExceeded"
	// RolloutTimeOutMessage is is added in a rollout when the rollout fails to show any progress
	// within the given deadline (progressDeadlineSeconds).
	RolloutTimeOutMessage = "Rollout %q has timed out progressing."
	// ReplicaSetTimeOutMessage is added in a rollout when its newest replica set fails to show any progress
	// within the given deadline (progressDeadlineSeconds).
	ReplicaSetTimeOutMessage = "ReplicaSet %q has timed out progressing."

	// RolloutCompletedMessage is added when the rollout is completed
	RolloutCompletedMessage = "Rollout %q has successfully progressed."
	// ReplicaSetCompletedMessage is added when the rollout is completed
	ReplicaSetCompletedMessage = "ReplicaSet %q has successfully progressed."

	// PausedRolloutReason is added in a rollout when it is paused. Lack of progress shouldn't be
	// estimated once a rollout is paused.
	PausedRolloutReason = "RolloutPaused"
	// PausedRolloutMessage is added in a rollout when it is paused. Lack of progress shouldn't be
	// estimated once a rollout is paused.
	PausedRolloutMessage = "Rollout is paused"
	// ResumedRolloutReason is added in a rollout when it is resumed. Useful for not failing accidentally
	// rollout that paused amidst a rollout and are bounded by a deadline.
	ResumedRolloutReason = "RolloutResumed"
	// ResumeRolloutMessage is added in a rollout when it is resumed. Useful for not failing accidentally
	// rollout that paused amidst a rollout and are bounded by a deadline.
	ResumeRolloutMessage = "Rollout is resumed"
	// ServiceNotFoundReason is added in a rollout when the service defined in the spec is not found
	ServiceNotFoundReason = "ServiceNotFound"
	// ServiceNotFoundMessage is added in a rollout when the service defined in the spec is not found
	ServiceNotFoundMessage = "Service %q is not found"
)

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 ReplicaSetToRolloutCondition added in v0.3.0

func ReplicaSetToRolloutCondition(cond appsv1.ReplicaSetCondition) v1alpha1.RolloutCondition

ReplicaSetToRolloutCondition converts a replica set condition into a rollout condition. Useful for promoting replica set failure conditions into rollout.

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 RolloutProgressing added in v0.3.0

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

RolloutProgressing reports progress for a rollout. Progress is estimated by comparing the current with the new status of the rollout that the controller is observing. More specifically, when new pods are scaled up, become ready or available, old pods are scaled down, or we modify the services, then we consider the rollout is progressing.

func RolloutTimedOut added in v0.3.0

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

RolloutTimedOut considers a rollout to have timed out once its condition that reports progress is older than progressDeadlineSeconds or a Progressing condition with a TimedOutReason reason already exists.

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