-
Notifications
You must be signed in to change notification settings - Fork 38
[FR-126] Rollback #274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[FR-126] Rollback #274
Changes from 2 commits
8459413
01d39f9
e990101
9f5ba18
0ff8504
371578c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -83,6 +83,10 @@ type TemporalWorkerDeploymentSpec struct { | |
| // How to rollout new workflow executions to the target version. | ||
| RolloutStrategy RolloutStrategy `json:"rollout"` | ||
|
|
||
| // How to rollback to a previous version. If not specified, defaults to AllAtOnce strategy. | ||
| // +optional | ||
| RollbackStrategy *RollbackStrategy `json:"rollback,omitempty"` | ||
|
eniko-dif marked this conversation as resolved.
|
||
|
|
||
| // How to manage sunsetting drained versions. | ||
| SunsetStrategy SunsetStrategy `json:"sunset"` | ||
|
|
||
|
|
@@ -355,6 +359,18 @@ const ( | |
| UpdateProgressive DefaultVersionUpdateStrategy = "Progressive" | ||
| ) | ||
|
|
||
| // DefaultVersionRollbackStrategy describes how to cut over during rollback to a previous version. | ||
| // +kubebuilder:validation:Enum=AllAtOnce;Progressive | ||
| type DefaultVersionRollbackStrategy string | ||
|
eniko-dif marked this conversation as resolved.
Outdated
|
||
|
|
||
| const ( | ||
| // RollbackAllAtOnce immediately switches 100% of traffic back to the previous version. | ||
| RollbackAllAtOnce DefaultVersionRollbackStrategy = "AllAtOnce" | ||
|
|
||
| // RollbackProgressive gradually ramps traffic back to the previous version. | ||
| RollbackProgressive DefaultVersionRollbackStrategy = "Progressive" | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think if we have a progressive rollout mode, we should also require that there be at least 1 step defined. It could be reasonable to assume that choosing the progressive rollout mode without also adding steps would reuse the existing steps from the rollout config. Without steps, progressive and all at once modes would behave the same way, right?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The validation is the same as for rollout, so there cannot be a no-step progressive strategy (done in the webhook). "It could be reasonable to assume that choosing the progressive rollout mode without also adding steps would reuse the existing steps from the rollout config." I would not assume this, it seems like a nasty side-effect, but if you think it's a good way forward, I can implement it. |
||
| ) | ||
|
|
||
| type GateWorkflowConfig struct { | ||
| WorkflowType string `json:"workflowType"` | ||
| // Input is an arbitrary JSON object passed as the first parameter to the gate workflow. | ||
|
|
@@ -396,6 +412,21 @@ type RolloutStrategy struct { | |
| Steps []RolloutStep `json:"steps,omitempty" protobuf:"bytes,3,rep,name=steps"` | ||
| } | ||
|
|
||
| // RollbackStrategy defines strategy to apply when rolling back to a previous version. | ||
| // This is separate from RolloutStrategy because rollbacks have different requirements: | ||
| // - No gate workflow (already trusted version) | ||
| // - No manual mode (rollbacks should be automatic) | ||
| // - Default to AllAtOnce for fast recovery | ||
| type RollbackStrategy struct { | ||
|
eniko-dif marked this conversation as resolved.
|
||
| // Strategy for rollback. Valid values are "AllAtOnce" or "Progressive". | ||
| // Defaults to "AllAtOnce" for fast recovery. | ||
| Strategy DefaultVersionRollbackStrategy `json:"strategy"` | ||
|
|
||
| // Steps to execute progressive rollbacks. Only required when strategy is "Progressive". | ||
| // +optional | ||
| Steps []RolloutStep `json:"steps,omitempty"` | ||
|
eniko-dif marked this conversation as resolved.
|
||
| } | ||
|
|
||
| // SunsetStrategy defines strategy to apply when sunsetting k8s deployments of drained versions. | ||
| type SunsetStrategy struct { | ||
| // ScaledownDelay specifies how long to wait after a version is drained before scaling its Deployment to zero. | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a change in behavior that should be called out in release notes.
Is there a way to disable rollbacks and keep the existing behavior of treating every version change as a new rollout? This should be documented as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now it's possible to disable the rollback by setting the max version age to 0. I've also updated the docs.