Skip to content

Commit

Permalink
Added better error message for copy-in/copy-out errors
Browse files Browse the repository at this point in the history
Signed-off-by: Blake Devcich <[email protected]>
  • Loading branch information
bdevcich committed Sep 26, 2023
1 parent fde8498 commit a1cd462
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions controllers/nnf_workflow_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -759,10 +759,13 @@ func (r *NnfWorkflowReconciler) finishDataInOutState(ctx context.Context, workfl
}

// Check results of data movement operations
// TODO: Detailed Fail Message?
for _, dm := range dataMovementList.Items {
if dm.Status.Status != nnfv1alpha1.DataMovementConditionReasonSuccess {
handleWorkflowErrorByIndex(dwsv1alpha2.NewResourceError("").WithUserMessage("data movement operation failed").WithFatal(), workflow, index)
// include the whole output for debugMsg; instruct user to look at the nnfdatamovement resource
debugMsg := fmt.Sprintf("%s:%s", dm.Status.Error.DebugMessage, dm.Status.Error.UserMessage)
userMsg := fmt.Sprintf("data movement operation failed: see %s/%s resource in the '%s' namespace for error details",
dm.Kind, dm.Name, dm.Namespace)
handleWorkflowErrorByIndex(dwsv1alpha2.NewResourceError(debugMsg).WithUserMessage(userMsg).WithFatal(), workflow, index)
return Requeue("error").withObject(&dm), nil
}
}
Expand Down

0 comments on commit a1cd462

Please sign in to comment.