Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Aaron Lehmann authored on 2016/12/14 10:20:37... | ... |
@@ -8,6 +8,7 @@ import ( |
8 | 8 |
"github.com/docker/docker/api/types/network" |
9 | 9 |
executorpkg "github.com/docker/docker/daemon/cluster/executor" |
10 | 10 |
clustertypes "github.com/docker/docker/daemon/cluster/provider" |
11 |
+ "github.com/docker/docker/plugin" |
|
11 | 12 |
networktypes "github.com/docker/libnetwork/types" |
12 | 13 |
"github.com/docker/swarmkit/agent/exec" |
13 | 14 |
"github.com/docker/swarmkit/agent/secrets" |
... | ... |
@@ -45,12 +46,39 @@ func (e *executor) Describe(ctx context.Context) (*api.NodeDescription, error) { |
45 | 45 |
} |
46 | 46 |
} |
47 | 47 |
|
48 |
+ // add v1 plugins |
|
48 | 49 |
addPlugins("Volume", info.Plugins.Volume) |
49 | 50 |
// Add builtin driver "overlay" (the only builtin multi-host driver) to |
50 | 51 |
// the plugin list by default. |
51 | 52 |
addPlugins("Network", append([]string{"overlay"}, info.Plugins.Network...)) |
52 | 53 |
addPlugins("Authorization", info.Plugins.Authorization) |
53 | 54 |
|
55 |
+ // add v2 plugins |
|
56 |
+ v2Plugins, err := plugin.GetManager().List() |
|
57 |
+ if err == nil { |
|
58 |
+ for _, plgn := range v2Plugins { |
|
59 |
+ for _, typ := range plgn.Config.Interface.Types { |
|
60 |
+ if typ.Prefix != "docker" || !plgn.Enabled { |
|
61 |
+ continue |
|
62 |
+ } |
|
63 |
+ plgnTyp := typ.Capability |
|
64 |
+ if typ.Capability == "volumedriver" { |
|
65 |
+ plgnTyp = "Volume" |
|
66 |
+ } else if typ.Capability == "networkdriver" { |
|
67 |
+ plgnTyp = "Network" |
|
68 |
+ } |
|
69 |
+ plgnName := plgn.Name |
|
70 |
+ if plgn.Tag != "" { |
|
71 |
+ plgnName += ":" + plgn.Tag |
|
72 |
+ } |
|
73 |
+ plugins[api.PluginDescription{ |
|
74 |
+ Type: plgnTyp, |
|
75 |
+ Name: plgnName, |
|
76 |
+ }] = struct{}{} |
|
77 |
+ } |
|
78 |
+ } |
|
79 |
+ } |
|
80 |
+ |
|
54 | 81 |
pluginFields := make([]api.PluginDescription, 0, len(plugins)) |
55 | 82 |
for k := range plugins { |
56 | 83 |
pluginFields = append(pluginFields, k) |