Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Hui Kang <[email protected]>
  • Loading branch information
Hui Kang committed Jul 16, 2021
1 parent 62cc7c2 commit eabcf84
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions docs/features/specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ spec:
# down. Defaults to nil
scaleDownDelayRevisionLimit: 2

# Adds a delay before scaling down the p preview replicaset if update is
# aborted. Default is 0, meaning preview replicaset are not scaled down.
# Adds a delay before scaling down the preview replicaset if update is
# aborted. Default is 0, meaning preview replicaset won't be scaled down.
AbortScaleDownDelaySeconds: 30

# Anti Affinity configuration between desired and previous ReplicaSet.
Expand Down
7 changes: 3 additions & 4 deletions rollout/replicaset.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,11 @@ func (c *rolloutContext) reconcileNewReplicaSet() (bool, error) {

abortScaleDownDelaySeconds := time.Duration(defaults.GetAbortScaleDownDelaySecondsOrDefault(c.rollout))
if c.isScaleDownOnabort() {
c.log.Info("scale down on abort for the newRS")
c.log.Infof("Scale down new rs '%s' on abort", c.newRS.Name)

// if the newRS has scale down annotation and to be scaled down now, set
// Update newReplicasCount = int32(0)
// if the newRS has scale down annotation, check if it should be scaled down now
if scaleDownAtStr, ok := c.newRS.Annotations[v1alpha1.DefaultReplicaSetScaleDownDeadlineAnnotationKey]; ok {
c.log.Infof("New rs '%s' has scaledown delay annotation: %s", c.newRS.Name, scaleDownAtStr)
c.log.Infof("New rs '%s' has scaledown deadline annotation: %s", c.newRS.Name, scaleDownAtStr)
scaleDownAtTime, err := time.Parse(time.RFC3339, scaleDownAtStr)
if err != nil {
c.log.Warnf("Unable to read scaleDownAt label on rs '%s'", c.newRS.Name)
Expand Down

0 comments on commit eabcf84

Please sign in to comment.