Merge pull request #74493 from cofyc/fix74384

Fix panic because VolumeSpec may be nil in volume reconstruction scenario
This commit is contained in:
Kubernetes Prow Robot 2019-02-25 20:28:19 -08:00 committed by GitHub
commit c7a9a150e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -732,7 +732,7 @@ func (og *operationGenerator) GenerateUnmountVolumeFunc(
podsDir string) (volumetypes.GeneratedOperations, error) {
var pluginName string
if useCSIPlugin(og.volumePluginMgr, volumeToUnmount.VolumeSpec) {
if volumeToUnmount.VolumeSpec != nil && useCSIPlugin(og.volumePluginMgr, volumeToUnmount.VolumeSpec) {
pluginName = csi.CSIPluginName
} else {
pluginName = volumeToUnmount.PluginName