From c75cd4e105d89d8f547dfd6af37158b82f6e9faf Mon Sep 17 00:00:00 2001 From: Pascal Breuninger Date: Tue, 25 Jun 2024 08:58:48 +0200 Subject: [PATCH] chore: warn if workspace is in non-recoverable state --- pkg/kubernetes/kubernetes.go | 1 + pkg/kubernetes/wait.go | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/kubernetes/kubernetes.go b/pkg/kubernetes/kubernetes.go index 6f533f7..9c86bd4 100644 --- a/pkg/kubernetes/kubernetes.go +++ b/pkg/kubernetes/kubernetes.go @@ -103,6 +103,7 @@ func (k *KubernetesDriver) infoFromObject(ctx context.Context, pvc *corev1.Persi pod, err := k.waitPodRunning(ctx, pvc.Name) if err != nil { k.Log.Infof("Error finding pod: %v", err) + k.Log.Warn("If the pod does not come up automatically it is stuck in an error state. Recreate the workspace to recover from this") pod = nil } diff --git a/pkg/kubernetes/wait.go b/pkg/kubernetes/wait.go index 0f44b4a..820962b 100644 --- a/pkg/kubernetes/wait.go +++ b/pkg/kubernetes/wait.go @@ -43,7 +43,7 @@ func (k *KubernetesDriver) waitPodRunning(ctx context.Context, id string) (*core return false, nil } - // check container status + // check init container status for _, c := range pod.Status.InitContainerStatuses { containerStatus := &c if IsWaiting(containerStatus) { @@ -101,6 +101,7 @@ func (k *KubernetesDriver) waitPodRunning(ctx context.Context, id string) (*core return true, nil }) + return pod, err }