Skip to content

Commit

Permalink
fix: change log level to warn level (#5790)
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Lo <lowc1012@gmail.com>
  • Loading branch information
lowc1012 authored and sarabala1979 committed May 5, 2021
1 parent cfd0fad commit e67cb42
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion util/errors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"regexp"
"strings"

log "github.com/sirupsen/logrus"
apierr "k8s.io/apimachinery/pkg/api/errors"

argoerrs "github.com/argoproj/argo-workflows/v3/errors"
Expand All @@ -17,7 +18,13 @@ func IsTransientErr(err error) bool {
return false
}
err = argoerrs.Cause(err)
return isExceededQuotaErr(err) || apierr.IsTooManyRequests(err) || isResourceQuotaConflictErr(err) || isTransientNetworkErr(err) || apierr.IsServerTimeout(err) || apierr.IsServiceUnavailable(err) || matchTransientErrPattern(err)
isTransient := isExceededQuotaErr(err) || apierr.IsTooManyRequests(err) || isResourceQuotaConflictErr(err) || isTransientNetworkErr(err) || apierr.IsServerTimeout(err) || apierr.IsServiceUnavailable(err) || matchTransientErrPattern(err)
if isTransient {
log.Infof("Transient error: %v", err)
} else {
log.Warnf("Non-transient error: %v", err)
}
return isTransient
}

func matchTransientErrPattern(err error) bool {
Expand Down

0 comments on commit e67cb42

Please sign in to comment.