Browse code

Pass plugingetter as part of swarm node config.

This is necessary for swarmkit to support cluster wide plugins, such as
globally scoped network plugins.

Signed-off-by: Anusha Ragunathan <anusha.ragunathan@docker.com>

Anusha Ragunathan authored on 2017/01/20 10:09:37
Showing 3 changed files
... ...
@@ -56,4 +56,5 @@ type Backend interface {
56 56
 	GetRepository(context.Context, reference.NamedTagged, *types.AuthConfig) (distribution.Repository, bool, error)
57 57
 	LookupImage(name string) (*types.ImageInspect, error)
58 58
 	PluginManager() *plugin.Manager
59
+	PluginGetter() *plugin.Store
59 60
 }
... ...
@@ -108,6 +108,7 @@ func (n *nodeRunner) start(conf nodeStartConfig) error {
108 108
 		ElectionTick:       3,
109 109
 		UnlockKey:          conf.lockKey,
110 110
 		AutoLockManagers:   conf.autolock,
111
+		PluginGetter:       n.cluster.config.Backend.PluginGetter(),
111 112
 	}
112 113
 	if conf.availability != "" {
113 114
 		avail, ok := swarmapi.NodeSpec_Availability_value[strings.ToUpper(string(conf.availability))]
... ...
@@ -1289,6 +1289,11 @@ func (daemon *Daemon) PluginManager() *plugin.Manager { // set up before daemon
1289 1289
 	return daemon.pluginManager
1290 1290
 }
1291 1291
 
1292
+// PluginGetter returns current pluginStore associated with the daemon
1293
+func (daemon *Daemon) PluginGetter() *plugin.Store {
1294
+	return daemon.PluginStore
1295
+}
1296
+
1292 1297
 // CreateDaemonRoot creates the root for the daemon
1293 1298
 func CreateDaemonRoot(config *Config) error {
1294 1299
 	// get the canonical path to the Docker root directory