diff options
author | Brian Goff <cpuguy83@gmail.com> | 2018-05-30 15:00:42 -0400 |
---|---|---|
committer | Brian Goff <cpuguy83@gmail.com> | 2018-05-30 15:22:10 -0400 |
commit | 7c77df8acc597cd4f540d873de5fe53a3d414ba9 (patch) | |
tree | a1127dd6e34dff9ac86e73f8cf095b2611f2a757 /volume | |
parent | b85799b63fb25423620ed16e717a99401cd3a39b (diff) | |
download | docker-7c77df8acc597cd4f540d873de5fe53a3d414ba9.tar.gz |
Move plugin client to separate interface
This makes it a bit simpler to remove this interface for v2 plugins
and not break external projects (libnetwork and swarmkit).
Note that before we remove the `Client()` interface from `CompatPlugin`
libnetwork and swarmkit must be updated to explicitly check for the v1
client interface as is done int his PR.
This is just a minor tweak that I realized is needed after trying to
implement the needed changes on libnetwork.
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Diffstat (limited to 'volume')
-rw-r--r-- | volume/drivers/extpoint.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/volume/drivers/extpoint.go b/volume/drivers/extpoint.go index f7d3617caa..5a3c4ce95a 100644 --- a/volume/drivers/extpoint.go +++ b/volume/drivers/extpoint.go @@ -212,9 +212,13 @@ func (s *Store) GetAllDrivers() ([]volume.Driver, error) { } func makePluginAdapter(p getter.CompatPlugin) (*volumeDriverAdapter, error) { + if pc, ok := p.(getter.PluginWithV1Client); ok { + return &volumeDriverAdapter{name: p.Name(), scopePath: p.ScopedPath, proxy: &volumeDriverProxy{pc.Client()}}, nil + } + pa, ok := p.(getter.PluginAddr) if !ok { - return &volumeDriverAdapter{name: p.Name(), scopePath: p.ScopedPath, proxy: &volumeDriverProxy{p.Client()}}, nil + return nil, errdefs.System(errors.Errorf("got unknown plugin instance %T", p)) } if pa.Protocol() != plugins.ProtocolSchemeHTTPV1 { |