Skip to content

Commit fc3f632

Browse files
authored
Use rollout rather than cutover in CRD JSON. (#93)
* Use `rollout` rather than `cutover` in CRD JSON. This matches the terms used internally.
1 parent 95940f4 commit fc3f632

File tree

7 files changed

+29
-29
lines changed

7 files changed

+29
-29
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,14 @@ flowchart TD
118118

119119
When a new worker deployment version is deployed, the worker controller detects it and automatically begins the process
120120
of making that version the new **current** (aka default) version of the worker deployment it is a part of. This could happen
121-
immediately if `cutover.strategy = AllAtOnce`, or gradually if `cutover.strategy = Progressive`.
121+
immediately if `rollout.strategy = AllAtOnce`, or gradually if `rollout.strategy = Progressive`.
122122

123123
As older pinned workflows finish executing and deprecated deployment versions become drained, the worker controller also
124124
frees up resources by sunsetting the `Deployment` resources polling those versions.
125125

126126
Here is an example of a progressive cut-over strategy gated on the success of the `HelloWorld` workflow:
127127
```yaml
128-
cutover:
128+
rollout:
129129
strategy: Progressive
130130
steps:
131131
- rampPercentage: 1

api/v1alpha1/temporalworker_webhook.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,22 +115,22 @@ func validateRolloutStrategy(s RolloutStrategy) []*field.Error {
115115
rolloutSteps := s.Steps
116116
if len(rolloutSteps) == 0 {
117117
allErrs = append(allErrs,
118-
field.Invalid(field.NewPath("spec.cutover.steps"), rolloutSteps, "steps are required for Progressive cutover"),
118+
field.Invalid(field.NewPath("spec.rollout.steps"), rolloutSteps, "steps are required for Progressive rollout"),
119119
)
120120
}
121121
var lastRamp float32
122122
for i, s := range rolloutSteps {
123123
// Check duration >= 30s
124124
if s.PauseDuration.Duration < 30*time.Second {
125125
allErrs = append(allErrs,
126-
field.Invalid(field.NewPath(fmt.Sprintf("spec.cutover.steps[%d].pauseDuration", i)), s.PauseDuration.Duration.String(), "pause duration must be at least 30s"),
126+
field.Invalid(field.NewPath(fmt.Sprintf("spec.rollout.steps[%d].pauseDuration", i)), s.PauseDuration.Duration.String(), "pause duration must be at least 30s"),
127127
)
128128
}
129129

130130
// Check ramp value greater than last
131131
if s.RampPercentage <= lastRamp {
132132
allErrs = append(allErrs,
133-
field.Invalid(field.NewPath(fmt.Sprintf("spec.cutover.steps[%d].rampPercentage", i)), s.RampPercentage, "rampPercentage must increase between each step"),
133+
field.Invalid(field.NewPath(fmt.Sprintf("spec.rollout.steps[%d].rampPercentage", i)), s.RampPercentage, "rampPercentage must increase between each step"),
134134
)
135135
}
136136
lastRamp = s.RampPercentage

api/v1alpha1/temporalworker_webhook_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func TestTemporalWorkerDeployment_ValidateCreate(t *testing.T) {
4646
obj.Spec.RolloutStrategy.Steps = nil
4747
return obj
4848
}),
49-
errorMsg: "spec.cutover.steps: Invalid value: []v1alpha1.RolloutStep(nil): steps are required for Progressive cutover",
49+
errorMsg: "spec.rollout.steps: Invalid value: []v1alpha1.RolloutStep(nil): steps are required for Progressive rollout",
5050
},
5151
"ramp value for step <= previous step": {
5252
obj: testhelpers.ModifyObj(testhelpers.MakeTWDWithName("prog-rollout-decreasing-ramps"), func(obj *temporaliov1alpha1.TemporalWorkerDeployment) *temporaliov1alpha1.TemporalWorkerDeployment {
@@ -61,7 +61,7 @@ func TestTemporalWorkerDeployment_ValidateCreate(t *testing.T) {
6161
}
6262
return obj
6363
}),
64-
errorMsg: "[spec.cutover.steps[2].rampPercentage: Invalid value: 9: rampPercentage must increase between each step, spec.cutover.steps[4].rampPercentage: Invalid value: 50: rampPercentage must increase between each step]",
64+
errorMsg: "[spec.rollout.steps[2].rampPercentage: Invalid value: 9: rampPercentage must increase between each step, spec.rollout.steps[4].rampPercentage: Invalid value: 50: rampPercentage must increase between each step]",
6565
},
6666
"pause duration < 30s": {
6767
obj: testhelpers.ModifyObj(testhelpers.MakeTWDWithName("prog-rollout-decreasing-ramps"), func(obj *temporaliov1alpha1.TemporalWorkerDeployment) *temporaliov1alpha1.TemporalWorkerDeployment {
@@ -73,7 +73,7 @@ func TestTemporalWorkerDeployment_ValidateCreate(t *testing.T) {
7373
}
7474
return obj
7575
}),
76-
errorMsg: `spec.cutover.steps[1].pauseDuration: Invalid value: "10s": pause duration must be at least 30s`,
76+
errorMsg: `spec.rollout.steps[1].pauseDuration: Invalid value: "10s": pause duration must be at least 30s`,
7777
},
7878
}
7979

api/v1alpha1/worker_types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ type TemporalWorkerDeploymentSpec struct {
5252
// not be estimated during the time a deployment is paused. Defaults to 600s.
5353
ProgressDeadlineSeconds *int32 `json:"progressDeadlineSeconds,omitempty" protobuf:"varint,9,opt,name=progressDeadlineSeconds"`
5454

55-
// How to cut over new workflow executions to the target version.
56-
RolloutStrategy RolloutStrategy `json:"cutover"`
55+
// How to rollout new workflow executions to the target version.
56+
RolloutStrategy RolloutStrategy `json:"rollout"`
5757

5858
// How to manage sunsetting drained versions.
5959
SunsetStrategy SunsetStrategy `json:"sunset"`

helm/temporal-worker-controller/templates/crds/temporal.io_temporalworkerdeployments.yaml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,20 @@ spec:
4646
type: object
4747
spec:
4848
properties:
49-
cutover:
49+
maxVersions:
50+
format: int32
51+
minimum: 1
52+
type: integer
53+
minReadySeconds:
54+
format: int32
55+
type: integer
56+
progressDeadlineSeconds:
57+
format: int32
58+
type: integer
59+
replicas:
60+
format: int32
61+
type: integer
62+
rollout:
5063
properties:
5164
gate:
5265
properties:
@@ -76,19 +89,6 @@ spec:
7689
required:
7790
- strategy
7891
type: object
79-
maxVersions:
80-
format: int32
81-
minimum: 1
82-
type: integer
83-
minReadySeconds:
84-
format: int32
85-
type: integer
86-
progressDeadlineSeconds:
87-
format: int32
88-
type: integer
89-
replicas:
90-
format: int32
91-
type: integer
9292
selector:
9393
properties:
9494
matchExpressions:
@@ -3760,7 +3760,7 @@ spec:
37603760
- temporalNamespace
37613761
type: object
37623762
required:
3763-
- cutover
3763+
- rollout
37643764
- sunset
37653765
- template
37663766
- workerOptions

internal/demo/helloworld/changes/progressive-rollout.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ index 926fc27..3e1fd51 100644
44
+++ b/internal/demo/helloworld/temporal_worker.yaml
55
@@ -12,9 +12,20 @@ spec:
66
temporalNamespace: "replay-2025.ktasd"
7-
# How to cut over new workflow executions to the latest worker version
8-
cutover:
7+
# How to rollout new workflow executions to the latest worker version
8+
rollout:
99
- strategy: AllAtOnce
1010
+ strategy: Progressive
1111
gate:

internal/demo/helloworld/temporal_worker_deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ spec:
1212
# temporalNamespace: "replay-2025.ktasd"
1313
temporalNamespace: "worker-controller-test.a2dd6"
1414

15-
# How to cut over new workflow executions to the latest worker version
16-
cutover:
15+
# How to rollout new workflow executions to the latest worker version
16+
rollout:
1717
strategy: Progressive
1818
steps:
1919
- rampPercentage: 1

0 commit comments

Comments
 (0)