fix expand panic

This commit is contained in:
NickrenREN 2018-01-03 10:31:57 +08:00
parent 5de71ab1d4
commit 74b197e7fe

View File

@ -1253,6 +1253,9 @@ func (og *operationGenerator) GenerateExpandVolumeFunc(
if err != nil {
return volumetypes.GeneratedOperations{}, fmt.Errorf("Error finding plugin for expanding volume: %q with error %v", pvcWithResizeRequest.QualifiedName(), err)
}
if volumePlugin == nil {
return volumetypes.GeneratedOperations{}, fmt.Errorf("Can not find plugin for expanding volume: %q", pvcWithResizeRequest.QualifiedName())
}
expandVolumeFunc := func() (error, error) {
newSize := pvcWithResizeRequest.ExpectedSize