From c53c083609f4b43857a414468a580251332d9d26 Mon Sep 17 00:00:00 2001 From: Pavel Tumik <18602811+sagor999@users.noreply.github.com> Date: Tue, 17 May 2022 21:45:42 +0000 Subject: [PATCH] [ws-daemon] log when ready probe fails --- components/ws-daemon/pkg/daemon/daemon.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/components/ws-daemon/pkg/daemon/daemon.go b/components/ws-daemon/pkg/daemon/daemon.go index 0b745f07833d1f..5371b57d85711e 100644 --- a/components/ws-daemon/pkg/daemon/daemon.go +++ b/components/ws-daemon/pkg/daemon/daemon.go @@ -16,6 +16,7 @@ import ( "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" + "github.com/gitpod-io/gitpod/common-go/log" "github.com/gitpod-io/gitpod/ws-daemon/api" "github.com/gitpod-io/gitpod/ws-daemon/pkg/cgroup" "github.com/gitpod-io/gitpod/ws-daemon/pkg/container" @@ -202,16 +203,21 @@ func (d *Daemon) Stop() error { func (d *Daemon) ReadinessProbe() func() error { return func() error { if d.hosts != nil && !d.hosts.DidUpdate() { - return fmt.Errorf("host controller not ready yet") + err := fmt.Errorf("host controller not ready yet") + log.WithError(err).Errorf("readiness probe failure") + return err } isContainerdReady, err := d.dispatch.Runtime.IsContainerdReady(context.Background()) if err != nil { + log.WithError(err).Errorf("readiness probe failure: containerd error") return fmt.Errorf("containerd error: %v", err) } if !isContainerdReady { - return fmt.Errorf("containerd is not ready") + err := fmt.Errorf("containerd is not ready") + log.WithError(err).Error("readiness probe failure") + return err } return nil