Documentation ¶
Index ¶
- Constants
- func ComputeStepHash(rollout *v1alpha1.Rollout) string
- func GetRolloutCondition(status v1alpha1.RolloutStatus, condType v1alpha1.RolloutConditionType) *v1alpha1.RolloutCondition
- func NewRolloutCondition(condType v1alpha1.RolloutConditionType, status corev1.ConditionStatus, ...) *v1alpha1.RolloutCondition
- func RemoveRolloutCondition(status *v1alpha1.RolloutStatus, condType v1alpha1.RolloutConditionType)
- func ReplicaSetToRolloutCondition(cond appsv1.ReplicaSetCondition) v1alpha1.RolloutCondition
- func RolloutCompleted(rollout *v1alpha1.Rollout, newStatus *v1alpha1.RolloutStatus) bool
- func RolloutHealthy(rollout *v1alpha1.Rollout, newStatus *v1alpha1.RolloutStatus) bool
- func RolloutProgressing(rollout *v1alpha1.Rollout, newStatus *v1alpha1.RolloutStatus) bool
- func RolloutTimedOut(rollout *v1alpha1.Rollout, newStatus *v1alpha1.RolloutStatus) bool
- func SetRolloutCondition(status *v1alpha1.RolloutStatus, condition v1alpha1.RolloutCondition) bool
Constants ¶
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)" // 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 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." )
Variables ¶
This section is empty.
Functions ¶
func ComputeStepHash ¶
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 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 ¶
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 ¶
func RolloutCompleted(rollout *v1alpha1.Rollout, newStatus *v1alpha1.RolloutStatus) bool
RolloutCompleted considers a rollout to be complete once StableRS == CurrentPodHash
func RolloutHealthy ¶
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 ¶
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 ¶
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) 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
Types ¶
This section is empty.