From aff10f57bb83ab155bee3ae720a467409ef896ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Cluseau?= Date: Mon, 20 Jul 2015 14:11:52 +1100 Subject: [PATCH] realContainerGC reports warning when err is nil --- pkg/kubelet/container_gc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/kubelet/container_gc.go b/pkg/kubelet/container_gc.go index c8ae50f30f1..1ec31e31e43 100644 --- a/pkg/kubelet/container_gc.go +++ b/pkg/kubelet/container_gc.go @@ -207,7 +207,7 @@ func (cgc *realContainerGC) removeOldestN(containers []containerGCInfo, toRemove } symlinkPath := dockertools.LogSymlink(cgc.containerLogsDir, containers[i].podNameWithNamespace, containers[i].containerName, containers[i].id) err = os.Remove(symlinkPath) - if !os.IsNotExist(err) { + if err != nil && !os.IsNotExist(err) { glog.Warningf("Failed to remove container %q log symlink %q: %v", containers[i].name, symlinkPath, err) } }