diff --git a/main.go b/main.go index 3c57178..cea03b3 100644 --- a/main.go +++ b/main.go @@ -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" @@ -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) }