Repository navigation
Conversation
Add spec.rollout.rollbackWindow, which replaces the fixed one-hour window used to decide whether a return to a previously current version is a rollback. It defaults to 1h, so existing deployments behave as before, and 0s disables rollback detection. Negative values are rejected by the CRD. Closes temporalio#698 Signed-off-by: Andrey Osipov <blaketsk@gmail.com>
blaketsk
requested review from
a team,
eniko-dif and
jlegrone
as code owners
November 28, 2026 07:50
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #698
What
spec.rollout.rollbackWindow(metav1.Duration). It replaces the fixed one-hour windowisRollbackScenariouses to decide whether returning to a previously current version is a rollback.1hthrough the CRD default andWorkerDeploymentSpec.Default, so existing deployments behave exactly as before.0sdisables rollback detection: every change of the target version goes through the configured strategy. This is an explicit check, so a server clock running slightly ahead of the controller cannot trigger a rollback.defaults.RollbackMaxVersionAgeis renamed todefaults.RollbackWindow.configuration.mdno longer says rollback is not configurable, and the field is listed inconcepts.md. The docs also state that a rollback does not wait for the gate workflow.I put the field under
rolloutbecause it decides whether that strategy is bypassed. If you'd prefer a different name or shape, for example a nestedrollback:struct or a controller-level default as the issue also mentions, I'm happy to change it.Note on what the window measures
The window is compared against the target version's
LastCurrentTime. The Temporal API defines that as when the version last became current, not when it was replaced. So to cover a rollback after a long rollout, the window has to span both how long the previous version stayed current and how long the new rollout took. The docs now say this explicitly.Measuring from the moment the version was replaced instead would match operators' intuition better. One option is the
LastCurrentTimeof the next version that became current. That changes the default behaviour, though, so I left it out of this PR. I can follow up if you think it's worth doing.Tested locally
go test ./...with envtest, including:TestIsRollbackScenariocases: a custom window inside and outside the version's age, and a zero window with a futureLastCurrentTime;Default()cases for the default and an explicit0s;1h,0saccepted, negative rejected.make lint.make manifests generate. Only theWorkerDeploymentand deprecatedTemporalWorkerDeploymentCRDs change, since they shareRolloutStrategy.