Add volume spec to mountedPod in actual state of world

Add volume spec into mountedPod data struct in the actual state of the
world.
This commit is contained in:
Jing Xu
2018-03-21 15:43:32 -07:00
parent df0518d07c
commit 264e4ed38c
11 changed files with 188 additions and 36 deletions

View File

@@ -250,7 +250,17 @@ func (plugin *FakeVolumePlugin) GetPluginName() string {
}
func (plugin *FakeVolumePlugin) GetVolumeName(spec *Spec) (string, error) {
return spec.Name(), nil
var volumeName string
if spec.Volume != nil && spec.Volume.GCEPersistentDisk != nil {
volumeName = spec.Volume.GCEPersistentDisk.PDName
} else if spec.PersistentVolume != nil &&
spec.PersistentVolume.Spec.GCEPersistentDisk != nil {
volumeName = spec.PersistentVolume.Spec.GCEPersistentDisk.PDName
}
if volumeName == "" {
volumeName = spec.Name()
}
return volumeName, nil
}
func (plugin *FakeVolumePlugin) CanSupport(spec *Spec) bool {