Skip to content

Commit

Permalink
Improve common code
Browse files Browse the repository at this point in the history
  • Loading branch information
sapk committed Mar 23, 2018
1 parent 8affaf0 commit 7613a51
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 13 additions & 2 deletions gluster/driver/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,28 @@ var (
//MountTimeout timeout before killing a mount try in seconds
MountTimeout = 30
//CfgVersion current config version compat
CfgVersion = 1
CfgVersion = 2
//CfgFolder config folder
CfgFolder = "/etc/docker-volumes/gluster/"
)

//GlusterDriver docker volume plugin driver extension of basic plugin
type GlusterDriver = basic.Driver

//Init start all needed deps and serve response to API call
func Init(root string, mountUniqName bool) *GlusterDriver {
logrus.Debugf("Init gluster driver at %s, UniqName: %v", root, mountUniqName)
return basic.Init(root, mountUniqName, CfgFolder, CfgVersion, isValidURI, mountVolume)
config := basic.DriverConfig{
Version: CfgVersion,
Root: root,
Folder: CfgFolder,
MountUniqName: mountUniqName,
}
eventHandler := basic.DriverEventHandler{
IsValidURI: isValidURI,
OnMountVolume: mountVolume,
}
return basic.Init(&config, &eventHandler)
}

func mountVolume(d *basic.Driver, v driver.Volume, m driver.Mount, r *volume.MountRequest) (*volume.MountResponse, error) {
Expand Down

0 comments on commit 7613a51

Please sign in to comment.