Skip to content

Commit

Permalink
Kubelet: stop logging "Error on reading termination-log..." messages
Browse files Browse the repository at this point in the history
If a pod was deleted and the associated volumes/directory were removed, there
could be a window where the pod worker is still active. If the pod worker tries
to inspect the logs, such an error would be logged. Since the pod has been
deleted, such error messages are meaningless.

This change stops logging this error, but stores the error string in the pod
status. The pod status will be updated for pods that are still alive, and will
be discarded eventually for deleted pods.
  • Loading branch information
yujuhong committed Jul 1, 2015
1 parent 9363285 commit d6ff297
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/kubelet/dockertools/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ func (dm *DockerManager) inspectContainer(dockerID, containerName, tPath string)
if found {
data, err := ioutil.ReadFile(path)
if err != nil {
glog.Errorf("Error on reading termination-log %s: %v", path, err)
result.status.State.Terminated.Message = fmt.Sprintf("Error on reading termination-log %s: %v", path, err)
} else {
result.status.State.Terminated.Message = string(data)
}
Expand Down

0 comments on commit d6ff297

Please sign in to comment.