From aa890a334da856e28939338da035c6724c4e4b10 Mon Sep 17 00:00:00 2001 From: Hemant Kumar Date: Mon, 24 Jul 2017 11:52:29 -0400 Subject: [PATCH] UPSTREAM: 49420: Fix c-m crash while verifying attached volumes --- .../pkg/volume/util/operationexecutor/operation_generator.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vendor/k8s.io/kubernetes/pkg/volume/util/operationexecutor/operation_generator.go b/vendor/k8s.io/kubernetes/pkg/volume/util/operationexecutor/operation_generator.go index 4c189d96dddc..2633649278eb 100644 --- a/vendor/k8s.io/kubernetes/pkg/volume/util/operationexecutor/operation_generator.go +++ b/vendor/k8s.io/kubernetes/pkg/volume/util/operationexecutor/operation_generator.go @@ -115,6 +115,10 @@ func (og *operationGenerator) GenerateVolumesAreAttachedFunc( volumeSpecMap := make(map[*volume.Spec]v1.UniqueVolumeName) // Iterate each volume spec and put them into a map index by the pluginName for _, volumeAttached := range attachedVolumes { + if volumeAttached.VolumeSpec == nil { + glog.Errorf("VerifyVolumesAreAttached.GenerateVolumesAreAttachedFunc: nil spec for volume %s", volumeAttached.VolumeName) + continue + } volumePlugin, err := og.volumePluginMgr.FindPluginBySpec(volumeAttached.VolumeSpec) if err != nil || volumePlugin == nil {