From db97cba2911d22032f4ab5caab703196710ac423 Mon Sep 17 00:00:00 2001 From: xiangpengzhao Date: Sat, 17 Dec 2016 03:35:56 -0500 Subject: [PATCH] Fix nil pointer issue when making mounts for container --- pkg/kubelet/kubelet_pods.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/kubelet/kubelet_pods.go b/pkg/kubelet/kubelet_pods.go index ff7a4645fd6..658f2dd4cb6 100644 --- a/pkg/kubelet/kubelet_pods.go +++ b/pkg/kubelet/kubelet_pods.go @@ -110,8 +110,8 @@ func makeMounts(pod *v1.Pod, podDir string, container *v1.Container, hostName, h for _, mount := range container.VolumeMounts { mountEtcHostsFile = mountEtcHostsFile && (mount.MountPath != etcHostsPath) vol, ok := podVolumes[mount.Name] - if !ok { - glog.Warningf("Mount cannot be satisfied for container %q, because the volume is missing: %q", container.Name, mount) + if !ok || vol.Mounter == nil { + glog.Warningf("Mount cannot be satisfied for container %q, because the volume is missing or the volume mounter is nil: %q", container.Name, mount) continue }