mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-06-11 09:53:38 -04:00
Added conversion and check to prevent panic
This commit is contained in:
parent
5fa07f57b6
commit
519cbc498b
1 changed files with 4 additions and 1 deletions
|
|
@ -189,5 +189,8 @@ func (pm *VolumePluginMgr) FindPersistentPluginByName(name string) (PersistentVo
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return volumePlugin.(PersistentVolumePlugin), nil
|
||||
if persistentVolumePlugin, ok := volumePlugin.(PersistentVolumePlugin); ok {
|
||||
return persistentVolumePlugin, nil
|
||||
}
|
||||
return nil, fmt.Errorf("no persistent volume plugin matched")
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue