conditions

package
v1.6.6 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: Apache-2.0 Imports: 15 Imported by: 5

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'"
	// RolloutSelectAllMessage the message to indicate that the rollout has an empty selector
	RolloutSelectAllMessage = "This rollout is selecting all pods. A non-empty selector is 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"
	// RolloutProgressingMessage is added in a rollout when one of its replica sets is updated as part
	// of the rollout process.
	RolloutProgressingMessage = "Rollout %q is progressing."
	// ReplicaSetProgressingMessage 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"
	//NewReplicaSetMessage is added in a rollout when it creates a new replicas set.
	NewReplicaSetMessage = "Created new replica set %q"
	// NewReplicaSetDetailedMessage is a more detailed format message
	NewReplicaSetDetailedMessage = "Created ReplicaSet %s (revision %d)"

	// 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"

	// RolloutUpdatedReason indicates the rollout spec was updated.
	RolloutUpdatedReason = "RolloutUpdated"
	// RolloutUpdatedMessage indicates the rollout spec was updated.
	RolloutUpdatedMessage = "Rollout updated to revision %s"

	// RolloutCompletedReason is added in a rollout when it is completed.
	RolloutCompletedReason = "RolloutCompleted"
	// RolloutCompletedMessage is added when the rollout is completed
	RolloutCompletedMessage = "Rollout completed update to revision %d (%s): %s"
	// RolloutNotCompletedReason is added in a rollout when it is completed.
	RolloutNotCompletedReason = "RolloutNotCompleted"
	// RolloutNotCompletedMessage is added when the rollout is completed
	RolloutNotCompletedMessage = "Rollout not completed, started update to revision %d (%s)"

	// RolloutHealthyReason is added in a rollout when it is healthy.
	RolloutHealthyReason = "RolloutHealthy"
	// RolloutHealthyMessage is added when the rollout is completed and is healthy or not.
	RolloutHealthyMessage = "Rollout is healthy"
	// RolloutNotHealthyMessage is added when the rollout is completed and is healthy or not.
	RolloutNotHealthyMessage = "Rollout is not healthy"

	// RolloutAbortedReason indicates that the rollout was aborted
	RolloutAbortedReason = "RolloutAborted"
	// RolloutAbortedMessage indicates that the rollout was aborted
	RolloutAbortedMessage = "Rollout aborted update to revision %d"

	// RolloutRetryReason indicates that the rollout is retrying after being aborted
	RolloutRetryReason = "RolloutRetry"
	// RolloutRetryMessage indicates that the rollout is retrying after being aborted
	RolloutRetryMessage = "Retrying Rollout after abort"

	// RolloutPausedReason is added in a rollout when it is paused. Lack of progress shouldn't be
	// estimated once a rollout is paused.
	RolloutPausedReason = "RolloutPaused"
	// RolloutPausedMessage is added in a rollout when it is paused. Lack of progress shouldn't be
	// estimated once a rollout is paused.
	RolloutPausedMessage = "Rollout is paused"

	// ReplicaSetNotAvailableReason is added when the replicaset of an rollout is not available.
	// This could happen when a fully promoted rollout becomes incomplete, e.g.,
	// due to  pod restarts, evicted -> recreated. In this case, we'll need to reset the rollout's
	// condition to `PROGRESSING` to avoid any timeouts.
	ReplicaSetNotAvailableReason = "ReplicaSetNotAvailable"

	// RolloutResumedReason 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.
	RolloutResumedReason = "RolloutResumed"
	// RolloutResumedMessage 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.
	RolloutResumedMessage = "Rollout is resumed"

	// RolloutStepCompleted indicates when a canary step has completed
	RolloutStepCompletedReason  = "RolloutStepCompleted"
	RolloutStepCompletedMessage = "Rollout step %d/%d completed (%s)"

	// TrafficWeightUpdated is emitted any time traffic weight is modified
	TrafficWeightUpdatedReason  = "TrafficWeightUpdated"
	TrafficWeightUpdatedMessage = "Traffic weight updated %s"

	// 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"

	// RolloutAnalysisRunFailedReason is added in a rollout when the analysisRun owned by a rollout fails or errors out
	RolloutAnalysisRunFailedReason = "AnalysisRunFailed"
	// RolloutAnalysisRunFailedMessage is added in a rollout when the analysisRun owned by a rollout fails or errors out
	RolloutAnalysisRunFailedMessage = "AnalysisRun '%s' owned by the Rollout '%q' failed."

	// RolloutExperimentFailedReason is added in a rollout when the analysisRun owned by a rollout fails to show any progress
	RolloutExperimentFailedReason = "ExperimentFailed"
	// RolloutExperimentFailedMessage is added in a rollout when the experiment owned by a rollout fails to show any progress
	RolloutExperimentFailedMessage = "Experiment '%s' owned by the Rollout '%q' has timed out."

	// 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 added in a rollout when the rollout fails to show any progress
	// within the given deadline (progressDeadlineSeconds).
	RolloutTimeOutMessage = "Rollout %q has timed out progressing."

	RolloutDeletedReason  = "RolloutDeleted"
	RolloutDeletedMessage = "Rollout %s/%s is deleted."

	ScalingReplicaSetReason  = "ScalingReplicaSet"
	ScalingReplicaSetMessage = "Scaled %s ReplicaSet %s (revision %d) from %d to %d"

	// 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."
	// ReplicaSetCompletedMessage is added when the rollout is completed
	ReplicaSetCompletedMessage = "ReplicaSet %q has successfully progressed."

	// ServiceReferenceReason is added to a Rollout when there is an error with a Service reference
	ServiceReferenceReason = "ServiceReferenceError"
	// ServiceReferencingManagedService is added in a rollout when the multiple rollouts reference a Rollout
	ServiceReferencingManagedService = "Service %q is managed by another Rollout"

	// TargetGroupHealthyReason is emitted when target group has been verified
	TargetGroupVerifiedReason              = "TargetGroupVerified"
	TargetGroupVerifiedRegistrationMessage = "Service %s (TargetGroup %s) verified: %d endpoints registered"
	TargetGroupVerifiedWeightsMessage      = "Service %s (TargetGroup %s) verified: canary weight %d set"
	// TargetGroupHealthyReason is emitted when target group has not been verified
	TargetGroupUnverifiedReason              = "TargetGroupUnverified"
	TargetGroupUnverifiedRegistrationMessage = "Service %s (TargetGroup %s) not verified: %d/%d endpoints registered"
	TargetGroupUnverifiedWeightsMessage      = "Service %s (TargetGroup %s) not verified: canary weight %d not yet set (current: %d)"
	// TargetGroupVerifyErrorReason is emitted when we fail to verify the health of a target group due to error
	TargetGroupVerifyErrorReason  = "TargetGroupVerifyError"
	TargetGroupVerifyErrorMessage = "Failed to verify Service %s (TargetGroup %s): %s"
	// WeightVerifyErrorReason is emitted when there is an error verifying the set weight
	WeightVerifyErrorReason  = "WeightVerifyError"
	WeightVerifyErrorMessage = "Failed to verify weight: %s"
	// LoadBalancerNotFoundReason is emitted when load balancer can not be found
	LoadBalancerNotFoundReason  = "LoadBalancerNotFound"
	LoadBalancerNotFoundMessage = "Failed to find load balancer: %s"

	RolloutAddedToInformerReason = "RolloutAddedToInformer"
)
View Source
const (
	// ExperimentProgressingMessage is added in a Experiment when one of its replica sets is updated as part
	// of the experiment process.
	ExperimentProgressingMessage = "Experiment %q is progressing."
	// ExperimentRunningMessage is added when a experiment has all the templates running
	ExperimentRunningMessage = "Experiment %q is running."
	// ExperimentCompletedMessage is added when the experiment is completed
	ExperimentCompletedMessage = "Experiment %q has successfully ran and completed."
	// ExperimentCompleteReason is added when the experiment is completed
	ExperimentCompleteReason = "ExperimentCompleted"
	// ExperimentTemplateNameRepeatedMessage message when name in spec.template is repeated
	ExperimentTemplateNameRepeatedMessage = "Experiment %s has repeated template name '%s' in templates"
	// ExperimentTemplateNameEmpty message when name in template is empty
	ExperimentTemplateNameEmpty = "Experiment %s has empty template name at index %d"
	// DurationLongerThanDeadlineMessage indicates the Duration is longer than ProgressDeadlineSeconds
	DurationLongerThanDeadlineMessage = "Duration cannot be longer than ProgressDeadlineSeconds"
	// ExperimentSelectAllMessage the message to indicate that the rollout has an empty selector
	ExperimentSelectAllMessage = "This experiment is selecting all pods at index %d. A non-empty selector is required."
	// ExperimentMinReadyLongerThanDeadlineMessage indicates the MinReadySeconds is longer than ProgressDeadlineSeconds
	ExperimentMinReadyLongerThanDeadlineMessage = "MinReadySeconds cannot be longer than ProgressDeadlineSeconds. Check template index %d"
)

Variables

This section is empty.

Functions

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 ExperimentProgressing added in v0.5.0

func ExperimentProgressing(experiment *v1alpha1.Experiment, newStatus v1alpha1.ExperimentStatus) bool

ExperimentProgressing determines if the experiment has made any progress

func ExperimentRunning added in v0.5.0

func ExperimentRunning(experiment *v1alpha1.Experiment) bool

ExperimentRunning indicates when a experiment has become healthy and started to run for the `spec.duration` time

func GetExperimentCondition added in v0.5.0

GetExperimentCondition returns the condition with the provided type.

func GetRolloutCondition

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

GetRolloutCondition returns the condition with the provided type.

func NewExperimentConditions added in v0.5.0

func NewExperimentConditions(condType v1alpha1.ExperimentConditionType, status corev1.ConditionStatus, reason, message string) *v1alpha1.ExperimentCondition

NewExperimentConditions takes arguments to create new Condition

func NewRolloutCondition

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

NewRolloutCondition creates a new rollout condition.

func RemoveExperimentCondition added in v0.5.0

func RemoveExperimentCondition(status *v1alpha1.ExperimentStatus, condType v1alpha1.ExperimentConditionType)

RemoveExperimentCondition removes the experiment condition with the provided type.

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 RolloutCompleted added in v1.3.0

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

RolloutCompleted considers a rollout to be complete once StableRS == CurrentPodHash

func RolloutHealthy added in v1.3.0

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

RolloutHealthy considers a rollout to be healthy 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 SetExperimentCondition added in v0.5.0

func SetExperimentCondition(status *v1alpha1.ExperimentStatus, condition v1alpha1.ExperimentCondition)

SetExperimentCondition updates the experiment 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 SetRolloutCondition

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

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 by returning false. Returns true if the condition was updated

func VerifyExperimentSpec added in v0.5.0

func VerifyExperimentSpec(experiment *v1alpha1.Experiment, prevCond *v1alpha1.ExperimentCondition) *v1alpha1.ExperimentCondition

VerifyExperimentSpec 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