Skip to content

Commit

Permalink
Rename AutoPromoteActiveServiceDelaySeconds to autoPromotionSeconds
Browse files Browse the repository at this point in the history
Improve and fix documentation for various fields
  • Loading branch information
jessesuen authored and dthomson25 committed May 17, 2019
1 parent e45ac4c commit f541d8d
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 49 deletions.
2 changes: 1 addition & 1 deletion controller/bluegreen.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func (c *Controller) reconcileBlueGreenPause(activeSvc *corev1.Service, rollout
return false
}
pauseStartTime := rollout.Status.PauseStartTime
autoPromoteActiveServiceDelaySeconds := rollout.Spec.Strategy.BlueGreenStrategy.AutoPromoteActiveServiceDelaySeconds
autoPromoteActiveServiceDelaySeconds := rollout.Spec.Strategy.BlueGreenStrategy.AutoPromotionSeconds
if autoPromoteActiveServiceDelaySeconds != nil && pauseStartTime != nil {
c.checkEnqueueRolloutDuringWait(rollout, *pauseStartTime, *autoPromoteActiveServiceDelaySeconds)
}
Expand Down
4 changes: 2 additions & 2 deletions controller/bluegreen_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ func TestBlueGreenHandlePause(t *testing.T) {

r1 := newBlueGreenRollout("foo", 1, nil, "active", "preview")
r2 := bumpVersion(r1)
r2.Spec.Strategy.BlueGreenStrategy.AutoPromoteActiveServiceDelaySeconds = pointer.Int32Ptr(10)
r2.Spec.Strategy.BlueGreenStrategy.AutoPromotionSeconds = pointer.Int32Ptr(10)

rs1 := newReplicaSetWithStatus(r1, "foo-895c6c4f9", 1, 1)
rs2 := newReplicaSetWithStatus(r2, "foo-5f79b78d7f", 1, 1)
Expand Down Expand Up @@ -234,7 +234,7 @@ func TestBlueGreenHandlePause(t *testing.T) {

r1 := newBlueGreenRollout("foo", 1, nil, "active", "preview")
r2 := bumpVersion(r1)
r2.Spec.Strategy.BlueGreenStrategy.AutoPromoteActiveServiceDelaySeconds = pointer.Int32Ptr(10)
r2.Spec.Strategy.BlueGreenStrategy.AutoPromotionSeconds = pointer.Int32Ptr(10)

rs1 := newReplicaSetWithStatus(r1, "foo-895c6c4f9", 1, 1)
rs2 := newReplicaSetWithStatus(r2, "foo-5f79b78d7f", 1, 1)
Expand Down
4 changes: 2 additions & 2 deletions controller/pause.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ func calculatePauseStatus(rollout *v1alpha1.Rollout, addPause bool) (*metav1.Tim
}

if paused && rollout.Spec.Strategy.BlueGreenStrategy != nil {
if pauseStartTime != nil && rollout.Spec.Strategy.BlueGreenStrategy.AutoPromoteActiveServiceDelaySeconds != nil {
if pauseStartTime != nil && rollout.Spec.Strategy.BlueGreenStrategy.AutoPromotionSeconds != nil {
now := metav1.Now()
autoPromoteActiveServiceDelaySeconds := *rollout.Spec.Strategy.BlueGreenStrategy.AutoPromoteActiveServiceDelaySeconds
autoPromoteActiveServiceDelaySeconds := *rollout.Spec.Strategy.BlueGreenStrategy.AutoPromotionSeconds
switchDeadline := pauseStartTime.Add(time.Duration(autoPromoteActiveServiceDelaySeconds) * time.Second)
if now.After(switchDeadline) {
return nil, false
Expand Down
21 changes: 12 additions & 9 deletions manifests/crds/rollout-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,8 @@ spec:
format: int32
type: integer
revisionHistoryLimit:
description: The number of old ReplicaSets to retain. This is a pointer
to distinguish between explicit zero and not specified. This is set
to the max value of int32 (i.e. 2147483647) by default, which means
"retaining all old ReplicaSets".
description: The number of old ReplicaSets to retain. If unspecified,
will retain 10 old ReplicaSets
format: int32
type: integer
selector: {}
Expand All @@ -75,10 +73,12 @@ spec:
description: Name of the service that the rollout modifies as
the active service.
type: string
autoPromoteActiveServiceDelaySeconds:
description: AutoPromoteActiveServiceDelaySeconds add a delay
before automatically promoting the ReplicaSet under the preview
service to the active service.
autoPromotionSeconds:
description: AutoPromotionSeconds automatically promotes the
current ReplicaSet to active after the specified pause delay
in seconds after the ReplicaSet becomes ready. If omitted,
the Rollout enters and remains in a paused state until manually
resumed by resetting spec.Paused to false.
format: int32
type: integer
previewReplicaCount:
Expand All @@ -94,7 +94,10 @@ spec:
type: string
scaleDownDelaySeconds:
description: ScaleDownDelaySeconds adds a delay before scaling
down the previous replicaset. See https://github.com/argoproj/argo-rollouts/issues/19#issuecomment-476329960
down the previous replicaset. If omitted, the Rollout waits
30 seconds before scaling down the previous ReplicaSet. A
minimum of 30 seconds is recommended to ensure IP table propagation
across the nodes in a cluster. See https://github.com/argoproj/argo-rollouts/issues/19#issuecomment-476329960
for more information
format: int32
type: integer
Expand Down
21 changes: 12 additions & 9 deletions manifests/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,8 @@ spec:
format: int32
type: integer
revisionHistoryLimit:
description: The number of old ReplicaSets to retain. This is a pointer
to distinguish between explicit zero and not specified. This is set
to the max value of int32 (i.e. 2147483647) by default, which means
"retaining all old ReplicaSets".
description: The number of old ReplicaSets to retain. If unspecified,
will retain 10 old ReplicaSets
format: int32
type: integer
selector: {}
Expand All @@ -76,10 +74,12 @@ spec:
description: Name of the service that the rollout modifies as
the active service.
type: string
autoPromoteActiveServiceDelaySeconds:
description: AutoPromoteActiveServiceDelaySeconds add a delay
before automatically promoting the ReplicaSet under the preview
service to the active service.
autoPromotionSeconds:
description: AutoPromotionSeconds automatically promotes the
current ReplicaSet to active after the specified pause delay
in seconds after the ReplicaSet becomes ready. If omitted,
the Rollout enters and remains in a paused state until manually
resumed by resetting spec.Paused to false.
format: int32
type: integer
previewReplicaCount:
Expand All @@ -95,7 +95,10 @@ spec:
type: string
scaleDownDelaySeconds:
description: ScaleDownDelaySeconds adds a delay before scaling
down the previous replicaset. See https://github.com/argoproj/argo-rollouts/issues/19#issuecomment-476329960
down the previous replicaset. If omitted, the Rollout waits
30 seconds before scaling down the previous ReplicaSet. A
minimum of 30 seconds is recommended to ensure IP table propagation
across the nodes in a cluster. See https://github.com/argoproj/argo-rollouts/issues/19#issuecomment-476329960
for more information
format: int32
type: integer
Expand Down
21 changes: 12 additions & 9 deletions manifests/namespace-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,8 @@ spec:
format: int32
type: integer
revisionHistoryLimit:
description: The number of old ReplicaSets to retain. This is a pointer
to distinguish between explicit zero and not specified. This is set
to the max value of int32 (i.e. 2147483647) by default, which means
"retaining all old ReplicaSets".
description: The number of old ReplicaSets to retain. If unspecified,
will retain 10 old ReplicaSets
format: int32
type: integer
selector: {}
Expand All @@ -76,10 +74,12 @@ spec:
description: Name of the service that the rollout modifies as
the active service.
type: string
autoPromoteActiveServiceDelaySeconds:
description: AutoPromoteActiveServiceDelaySeconds add a delay
before automatically promoting the ReplicaSet under the preview
service to the active service.
autoPromotionSeconds:
description: AutoPromotionSeconds automatically promotes the
current ReplicaSet to active after the specified pause delay
in seconds after the ReplicaSet becomes ready. If omitted,
the Rollout enters and remains in a paused state until manually
resumed by resetting spec.Paused to false.
format: int32
type: integer
previewReplicaCount:
Expand All @@ -95,7 +95,10 @@ spec:
type: string
scaleDownDelaySeconds:
description: ScaleDownDelaySeconds adds a delay before scaling
down the previous replicaset. See https://github.com/argoproj/argo-rollouts/issues/19#issuecomment-476329960
down the previous replicaset. If omitted, the Rollout waits
30 seconds before scaling down the previous ReplicaSet. A
minimum of 30 seconds is recommended to ensure IP table propagation
across the nodes in a cluster. See https://github.com/argoproj/argo-rollouts/issues/19#issuecomment-476329960
for more information
format: int32
type: integer
Expand Down
10 changes: 5 additions & 5 deletions pkg/apis/rollouts/v1alpha1/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 14 additions & 10 deletions pkg/apis/rollouts/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,7 @@ type RolloutSpec struct {
// The deployment strategy to use to replace existing pods with new ones.
// +optional
Strategy RolloutStrategy `json:"strategy"`
// The number of old ReplicaSets to retain.
// This is a pointer to distinguish between explicit zero and not specified.
// This is set to the max value of int32 (i.e. 2147483647) by default, which means
// "retaining all old ReplicaSets".
// The number of old ReplicaSets to retain. If unspecified, will retain 10 old ReplicaSets
RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty"`
// Paused pauses the rollout at its current step.
Paused bool `json:"paused,omitempty"`
Expand Down Expand Up @@ -81,11 +78,17 @@ type BlueGreenStrategy struct {
// resumed the new replicaset will be full scaled up before the switch occurs
// +optional
PreviewReplicaCount *int32 `json:"previewReplicaCount,omitempty"`
// AutoPromoteActiveServiceDelaySeconds add a delay before automatically promoting the ReplicaSet under the preview
// service to the active service.
AutoPromoteActiveServiceDelaySeconds *int32 `json:"autoPromoteActiveServiceDelaySeconds,omitempty"`
// ScaleDownDelaySeconds adds a delay before scaling down the previous replicaset. See
// https://github.com/argoproj/argo-rollouts/issues/19#issuecomment-476329960 for more information
// AutoPromotionSeconds automatically promotes the current ReplicaSet to active after the
// specified pause delay in seconds after the ReplicaSet becomes ready.
// If omitted, the Rollout enters and remains in a paused state until manually resumed by
// resetting spec.Paused to false.
// +optional
AutoPromotionSeconds *int32 `json:"autoPromotionSeconds,omitempty"`
// ScaleDownDelaySeconds adds a delay before scaling down the previous replicaset.
// If omitted, the Rollout waits 30 seconds before scaling down the previous ReplicaSet.
// A minimum of 30 seconds is recommended to ensure IP table propagation across the nodes in
// a cluster. See https://github.com/argoproj/argo-rollouts/issues/19#issuecomment-476329960 for
// more information
// +optional
ScaleDownDelaySeconds *int32 `json:"scaleDownDelaySeconds,omitempty"`
}
Expand Down Expand Up @@ -126,7 +129,8 @@ type CanaryStrategy struct {
type CanaryStep struct {
// SetWeight sets what percentage of the newRS should receive
SetWeight *int32 `json:"setWeight,omitempty"`
// Pause freezes the rollout. If an empty struct is provided, it will freeze until a user sets the spec.Pause to false
// Pause freezes the rollout by setting spec.Paused to true.
// A Rollout will resume when spec.Paused is reset to false.
// +optional
Pause *RolloutPause `json:"pause,omitempty"`
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/apis/rollouts/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f541d8d

Please sign in to comment.