Skip to content

[ws-manager-mk2] Extract headless task failure (WKS-18) #17091

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion components/ws-manager-mk2/controllers/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,11 @@ func extractFailure(ws *workspacev1.Workspace, pod *corev1.Pod) (string, *worksp
}
} else if terminationState.Reason == "Completed" && !isPodBeingDeleted(pod) {
if ws.IsHeadless() {
// headless workspaces are expected to finish
// headless workspaces are expected to finish. But if they have a termination message,
// there was a failure.
if terminationState.Message != "" {
return terminationState.Message, nil
}
return "", nil
}
return fmt.Sprintf("container %s completed; containers of a workspace pod are not supposed to do that", cs.Name), nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,11 @@ func (r *WorkspaceReconciler) Reconcile(ctx context.Context, req ctrl.Request) (
r.updateMetrics(ctx, &workspace)
r.emitPhaseEvents(ctx, &workspace, oldStatus)

log.V(1).Info("updating workspace status", "status", workspace.Status)
var podStatus *corev1.PodStatus
if len(workspacePods.Items) > 0 {
podStatus = &workspacePods.Items[0].Status
}
log.Info("updating workspace status", "status", workspace.Status, "podStatus", podStatus)
err = r.Status().Update(ctx, &workspace)
if err != nil {
// log.WithValues("status", workspace).Error(err, "unable to update workspace status")
Expand Down