From cf4840fb54d1ed529d210ab3c7cff1889243dc4f Mon Sep 17 00:00:00 2001 From: Jesse Haka Date: Wed, 11 Dec 2019 11:34:33 +0200 Subject: [PATCH] only two times --- cmd/kops/rollingupdatecluster.go | 2 +- pkg/instancegroups/instancegroups.go | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/cmd/kops/rollingupdatecluster.go b/cmd/kops/rollingupdatecluster.go index 51db456f13f3b..1df6c67d94f69 100644 --- a/cmd/kops/rollingupdatecluster.go +++ b/cmd/kops/rollingupdatecluster.go @@ -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) } diff --git a/pkg/instancegroups/instancegroups.go b/pkg/instancegroups/instancegroups.go index 6d6d7752c1f2e..6c85dcbb7f411 100644 --- a/pkg/instancegroups/instancegroups.go +++ b/pkg/instancegroups/instancegroups.go @@ -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 }