Add a less scary message to the user when retries are still in progress (#2141)

When a failing check is being retried, we show the current err to the user. This
can sometimes be unnecessarily alarming, as in the case of the control plane
starting up.

If a failing check is in the process of being retried, wait to show the final
error message until the retries have completed.
This commit is contained in:
Risha Mars 2019-01-24 10:24:59 -08:00 committed by GitHub
parent e7556d7edc
commit 950c952d14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -15,6 +15,7 @@ import (
"github.com/linkerd/linkerd2/pkg/k8s"
"github.com/linkerd/linkerd2/pkg/profiles"
"github.com/linkerd/linkerd2/pkg/version"
log "github.com/sirupsen/logrus"
authorizationapi "k8s.io/api/authorization/v1beta1"
"k8s.io/api/core/v1"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@ -634,6 +635,9 @@ func (hc *HealthChecker) runCheck(categoryID CategoryID, c *checker, observer ch
if err != nil && time.Now().Before(c.retryDeadline) {
checkResult.Retry = true
checkResult.Err = errors.New("waiting for check to complete")
log.Debugf("Retrying on error: %s", err)
observer(checkResult)
time.Sleep(retryWindow)
continue

View File

@ -278,7 +278,7 @@ func TestHealthChecker(t *testing.T) {
expectedResults := []string{
"cat1 desc1 retry=false",
"cat7 desc7 retry=true: retry",
"cat7 desc7 retry=true: waiting for check to complete",
"cat7 desc7 retry=false",
}