-
Notifications
You must be signed in to change notification settings - Fork 38.8k
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
Capture application termination messages/output #2225
Conversation
@@ -269,6 +269,9 @@ func validateContainers(containers []api.Container, volumes util.StringSet) errs | |||
} | |||
cErrs = append(cErrs, validatePorts(ctr.Ports).Prefix("ports")...) | |||
cErrs = append(cErrs, validateEnv(ctr.Env).Prefix("env")...) | |||
if len(ctr.TerminationMessagePath) == 0 { | |||
ctr.TerminationMessagePath = "/dev/termination-log" |
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.
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.
hmm, this has nothing to do with our RESTful API. This is docker container creator / users to indicate where the application should dump its final log inside container mount namespace.
445141a
to
f9a90b9
Compare
Addressed all comments, especially moving default setting of terminationMessagePath from validation.go to conversion code. Like what we discussed offline, this PR support most of cases, but not support symbolic link, like glog case. Will file a separate issue to kubernetes or docker to handle that case. |
for i := range out.Containers { | ||
ctr := &out.Containers[i] | ||
if len(ctr.TerminationMessagePath) == 0 { | ||
ctr.TerminationMessagePath = "/dev/termination-log" |
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.
Make this a constant somewhere
…code to assign the default path. Move default setting for terminationMessagePath to conversion from validation. Addressed other comments.
the message to the upper layer through ContainerStatus.
3877bbd
to
57454cc
Compare
Add TODO, squash the commits into 3 logic commits. |
Thanks. Will merge when green. |
Capture application termination messages/output
Fix #139
Next PR is cleaning up the host file created for dead containers which should be garbage collected.