Skip to content

Commit

Permalink
only two times
Browse files Browse the repository at this point in the history
  • Loading branch information
zetaab committed Dec 11, 2019
1 parent 7af196f commit cf4840f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/kops/rollingupdatecluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ func RunRollingUpdateCluster(f *util.Factory, out io.Writer, options *RollingUpd
ValidationTimeout: options.ValidationTimeout,
// TODO should we expose this to the UI?
ValidateTickDuration: 30 * time.Second,
ValidateSuccessDuration: 15 * time.Second,
ValidateSuccessDuration: 10 * time.Second,
}
return d.RollingUpdate(groups, cluster, list)
}
9 changes: 6 additions & 3 deletions pkg/instancegroups/instancegroups.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,15 +248,18 @@ func (r *RollingUpdateInstanceGroup) validateClusterWithDuration(rollingUpdateDa
}
}

// validateClusterWithDurationLoop validates cluster 3 times to make sure cluster does not flap
// validateClusterWithDurationLoop validates cluster 2 times to make sure cluster does not flap
func (r *RollingUpdateInstanceGroup) validateClusterWithDurationLoop(rollingUpdateData *RollingUpdateCluster, duration time.Duration) error {
var err error
for i := 1; i <= 3; i++ {
for i := 1; i <= 2; i++ {
err = r.validateClusterWithDuration(rollingUpdateData, duration)
if err != nil {
return err
}
time.Sleep(rollingUpdateData.ValidateSuccessDuration / 3)
if i == 2 {
break
}
time.Sleep(rollingUpdateData.ValidateSuccessDuration)
}
return nil
}
Expand Down

0 comments on commit cf4840f

Please sign in to comment.