mirror of
https://github.com/docker/cli.git
synced 2026-09-28 02:06:53 -04:00
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> Upstream-commit: 7c77df8acc597cd4f540d873de5fe53a3d414ba9 Component: engine
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user