Skip to content

Commit

Permalink
[ws-daemon] log when ready probe fails
Browse files Browse the repository at this point in the history
  • Loading branch information
sagor999 committed May 17, 2022
1 parent 6b11a82 commit c53c083
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions components/ws-daemon/pkg/daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c53c083

Please sign in to comment.