Skip to content
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

Merged
merged 4 commits into from Feb 22, 2021
Merged

Conversation

simster7
Copy link
Member

@simster7 simster7 commented Feb 22, 2021

Before:
image

image

After:

image
image

Signed-off-by: Simon Behar <simbeh7@gmail.com>
@@ -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)
Copy link
Contributor

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

splitChar = ","
}
if annotatedMsg != "" && annotatedMsg != t.Message {
msg = fmt.Sprintf("%s%s %s", msg, splitChar, annotatedMsg)
Copy link
Contributor

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)
Copy link
Contributor

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

Signed-off-by: Simon Behar <simbeh7@gmail.com>
@alexec
Copy link
Contributor

alexec commented Feb 22, 2021

@simster7 just a thought - do you want to pull the changes that remove AnnotationKeyNodeMessage and use util.WriteTeriminateMessage(message) instead from this PR and we can complete this?

https://github.com/argoproj/argo-workflows/pull/5155/files#diff-65cf98a4431064c9f084d3ef4b797c74720a080aa0bd351c36121b968e7f7914L44

@simster7
Copy link
Member Author

@simster7 just a thought - do you want to pull the changes that remove AnnotationKeyNodeMessage and use util.WriteTeriminateMessage(message) instead from this PR and we can complete this?

https://github.com/argoproj/argo-workflows/pull/5155/files#diff-65cf98a4431064c9f084d3ef4b797c74720a080aa0bd351c36121b968e7f7914L44

Sure, I'll pull the relevant changes from #5155 to this PR

Signed-off-by: Simon Behar <simbeh7@gmail.com>
@simster7
Copy link
Member Author

Sure, I'll pull the relevant changes from #5155 to this PR

Done

Signed-off-by: Simon Behar <simbeh7@gmail.com>
@simster7 simster7 merged commit bec80c8 into argoproj:master Feb 22, 2021
@simster7 simster7 mentioned this pull request Feb 23, 2021
34 tasks
@simster7 simster7 mentioned this pull request Mar 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants