From d6ff297a1fe7de68aec9c7deaae540c08872f837 Mon Sep 17 00:00:00 2001 From: Yu-Ju Hong Date: Wed, 1 Jul 2015 14:20:42 -0700 Subject: [PATCH] Kubelet: stop logging "Error on reading termination-log..." messages 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. --- pkg/kubelet/dockertools/manager.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/kubelet/dockertools/manager.go b/pkg/kubelet/dockertools/manager.go index 37f40d2c7d3..83434a0f546 100644 --- a/pkg/kubelet/dockertools/manager.go +++ b/pkg/kubelet/dockertools/manager.go @@ -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) }