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

feat(executor): Move exit code capture to controller. See #5251 #5254

Closed
wants to merge 2 commits into from

Conversation

alexec
Copy link
Contributor

@alexec alexec commented Mar 2, 2021

See #5251

Signed-off-by: Alex Collins <alex_collins@intuit.com>
Signed-off-by: Alex Collins <alex_collins@intuit.com>
Comment on lines +1202 to +1209
if node.Outputs != nil && node.Outputs.ExitCode == nil {
for _, c := range pod.Status.ContainerStatuses {
if c.Name == common.MainContainerName && c.State.Terminated != nil {
node.Outputs.ExitCode = pointer.StringPtr(fmt.Sprint(c.State.Terminated.ExitCode))
updated = true
}
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MUCH better

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why have buggy code in the executor where it is hard to test when you can have that buggy code in the controller

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code should run before PodGC. I think it should be. we need to test the edge cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This runs whenever the exit code is known (because the container is terminated) but has not been set yet.

I'm doubling-down on this refactoring.

@alexec alexec marked this pull request as ready for review March 2, 2021 04:20
@alexec alexec linked an issue Mar 2, 2021 that may be closed by this pull request
@alexec
Copy link
Contributor Author

alexec commented Mar 2, 2021

Closing. Re-opening shortly.

@alexec alexec closed this Mar 2, 2021
@alexec alexec deleted the exit-code branch March 2, 2021 16:34
@alexec alexec restored the exit-code branch March 3, 2021 00:31
@alexec alexec deleted the exit-code branch March 3, 2021 00:31
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.

Workflow - Could not get container status
3 participants