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

Capture application termination messages/output #2225

Merged
merged 3 commits into from
Nov 10, 2014

Conversation

dchen1107
Copy link
Member

Fix #139

Next PR is cleaning up the host file created for dead containers which should be garbage collected.

@dchen1107
Copy link
Member Author

cc/ @bgrant0607 @brendanburns

@@ -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"
Copy link
Member

Choose a reason for hiding this comment

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

We shouldn't set the default in the validation code. It should just validate.

@lavalamp has proposed we do it in pkg/api/"version"/conversion.go. See #1502.

Copy link
Member Author

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.

@dchen1107
Copy link
Member Author

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

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.
@dchen1107
Copy link
Member Author

Add TODO, squash the commits into 3 logic commits.

@bgrant0607
Copy link
Member

Thanks. Will merge when green.

bgrant0607 added a commit that referenced this pull request Nov 10, 2014
Capture application termination messages/output
@bgrant0607 bgrant0607 merged commit 3cf17c0 into kubernetes:master Nov 10, 2014
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.

Capture application termination messages/output
3 participants