Skip to content

Commit

Permalink
chore: warn if workspace is in non-recoverable state
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalbreuninger committed Jun 25, 2024
1 parent 38d10a6 commit c75cd4e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions pkg/kubernetes/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
3 changes: 2 additions & 1 deletion pkg/kubernetes/wait.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -101,6 +101,7 @@ func (k *KubernetesDriver) waitPodRunning(ctx context.Context, id string) (*core

return true, nil
})

return pod, err
}

Expand Down

0 comments on commit c75cd4e

Please sign in to comment.