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
fix: Better message formating for nodes #5160
Conversation
Signed-off-by: Simon Behar <simbeh7@gmail.com>
workflow/controller/operator.go
Outdated
@@ -1320,7 +1328,7 @@ func inferFailedReason(pod *apiv1.Pod) (wfv1.NodePhase, string) { | |||
// executor is expected to annotate a message to the pod upon any errors. | |||
// If we failed to see the annotated message, it is likely the pod ran with | |||
// insufficient privileges. Give a hint to that effect. | |||
return wfv1.NodeError, fmt.Sprintf("%s; verify serviceaccount %s:%s has necessary privileges", msg, pod.Namespace, pod.Spec.ServiceAccountName) | |||
return wfv1.NodeError, fmt.Sprintf("%s%s verify serviceaccount %s:%s has necessary privileges", msg, splitChar, pod.Namespace, pod.Spec.ServiceAccountName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the case of 403 errors, the error message as actually enough to point out the problem, so I think we should just return msg
here
workflow/controller/operator.go
Outdated
splitChar = "," | ||
} | ||
if annotatedMsg != "" && annotatedMsg != t.Message { | ||
msg = fmt.Sprintf("%s%s %s", msg, splitChar, annotatedMsg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should get rid of annotatedMsg
completely - because ContainerStatus.Message
is usually the same thing, but not for this PR.
@@ -1309,7 +1309,15 @@ func inferFailedReason(pod *apiv1.Pod) (wfv1.NodePhase, string) { | |||
continue | |||
} | |||
|
|||
msg := fmt.Sprintf("exit code %d: %s; %s; %s", t.ExitCode, t.Reason, t.Message, annotatedMsg) | |||
msg := fmt.Sprintf("%s (exit code %d)", t.Reason, t.ExitCode) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree - this is easier to read
@simster7 just a thought - do you want to pull the changes that remove |
Signed-off-by: Simon Behar <simbeh7@gmail.com>
Done |
Before:
After: