Remove back-compat hacks from for volume plugins.

Hacks were added as interim support for 1.10 but should not be needed
for 1.11.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 3403a01b07a73defe9f15c30e16ec8dfcab50439
Component: engine
This commit is contained in:
Brian Goff
2016-02-10 12:19:32 -05:00
parent 13ec79c31c
commit 91c83926d7
2 changed files with 3 additions and 258 deletions

View File

@ -1,9 +1,6 @@
package volumedrivers
import (
"github.com/docker/docker/pkg/plugins"
"github.com/docker/docker/volume"
)
import "github.com/docker/docker/volume"
type volumeDriverAdapter struct {
name string
@ -15,21 +12,7 @@ func (a *volumeDriverAdapter) Name() string {
}
func (a *volumeDriverAdapter) Create(name string, opts map[string]string) (volume.Volume, error) {
// First try a Get. For drivers that support Get this will return any
// existing volume.
v, err := a.proxy.Get(name)
if v != nil {
return &volumeAdapter{
proxy: a.proxy,
name: v.Name,
driverName: a.Name(),
eMount: v.Mountpoint,
}, nil
}
// Driver didn't support Get or volume didn't exist. Perform Create.
err = a.proxy.Create(name, opts)
if err != nil {
if err := a.proxy.Create(name, opts); err != nil {
return nil, err
}
return &volumeAdapter{
@ -63,11 +46,7 @@ func (a *volumeDriverAdapter) List() ([]volume.Volume, error) {
func (a *volumeDriverAdapter) Get(name string) (volume.Volume, error) {
v, err := a.proxy.Get(name)
if err != nil {
// TODO: remove this hack. Allows back compat with volume drivers that don't support this call
if !plugins.IsNotFound(err) {
return nil, err
}
return a.Create(name, nil)
return nil, err
}
return &volumeAdapter{