conditions

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2020 License: Apache-2.0 Imports: 18 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'"
	// 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."
	// 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 one of the following set: experiment, setWeight, or pause"
	// ScaleDownDelayLongerThanDeadlineMessage indicates the ScaleDownDelaySeconds is longer than ProgressDeadlineSeconds
	ScaleDownDelayLongerThanDeadlineMessage = "ScaleDownDelaySeconds cannot be longer than ProgressDeadlineSeconds"
	// RolloutMinReadyLongerThanDeadlineMessage indicates the MinReadySeconds is longer than ProgressDeadlineSeconds
	RolloutMinReadyLongerThanDeadlineMessage = "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."
	// ScaleDownLimitLargerThanRevisionLimit the message to indicate that the rollout's revision history limit can not be smaller than the rollout's scale down limit
	ScaleDownLimitLargerThanRevisionLimit = "This rollout's revision history limit can not be smaller than the rollout's scale down limit"
	// 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"
	// 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"

	// RolloutAbortedReason indicates that the rollout was aborted
	RolloutAbortedReason = "RolloutAborted"
	// RolloutAbortedMessage indicates that the rollout was aborted
	RolloutAbortedMessage = "Rollout is aborted"
	// 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"

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

func HasRevisionHistoryLimit(r *v1alpha1.Rollout) bool

HasRevisionHistoryLimit checks if the RevisionHistoryLimit field is set

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 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 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)

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 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.

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