Skip to content
This repository has been archived by the owner on Nov 9, 2020. It is now read-only.

Commit

Permalink
Fixed plugin mount to handle invalid fs type.
Browse files Browse the repository at this point in the history
  • Loading branch information
govint committed Oct 21, 2016
1 parent 7073716 commit f021a86
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion vmdk_plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,18 @@ func getMountPoint(volName string) string {

// Get info about a single volume
func (d *vmdkDriver) Get(r volume.Request) volume.Response {
log.Debug("calling GET ")
status, err := d.ops.Get(r.Name)
log.Debug("returned GET ")
if err != nil {
return volume.Response{Err: err.Error()}
}
mountpoint := getMountPoint(r.Name)
return volume.Response{Volume: &volume.Volume{Name: r.Name,
response := volume.Response{Volume: &volume.Volume{Name: r.Name,
Mountpoint: mountpoint,
Status: status}}
log.Debug("got response", response)
return response
}

// List volumes known to the driver
Expand Down Expand Up @@ -361,6 +365,11 @@ func (d *vmdkDriver) Mount(r volume.MountRequest) volume.Response {
isReadOnly = true
}

_, exists := status["fstype"]

if !exists {
return volume.Response{Err: "Invalid filesystem type."}
}
mountpoint, err := d.mountVolume(r.Name, status["fstype"].(string), isReadOnly)
if err != nil {
log.WithFields(
Expand Down

0 comments on commit f021a86

Please # to comment.