Skip to content

Commit

Permalink
extend k8s server errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulexus committed Mar 12, 2021
1 parent 7ff7a1d commit 3f400a5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/rotisserie/eris"
"go.uber.org/zap"
v1 "k8s.io/api/core/v1"
kerrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/kubernetes"
Expand Down Expand Up @@ -108,6 +109,10 @@ func main() {
err = m.watch(ctx)
if errors.Cause(err) == io.EOF {
log.Debugw("gRPC connection timed out")
} else if kerr, ok := errors.Cause(err).(*kerrors.StatusError); ok {
errString, errData := kerr.DebugError()

log.Warnf("watch exited" + errString, errData)
} else {
log.Warnw("watch exited", "error", err)
}
Expand Down

0 comments on commit 3f400a5

Please sign in to comment.