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
... ...
@@ -332,6 +332,7 @@ func (c *Cluster) startNewNode(conf nodeStartConfig) (*node, error) {
332 332
 		ElectionTick:       3,
333 333
 		UnlockKey:          conf.lockKey,
334 334
 		AutoLockManagers:   conf.autolock,
335
+		PluginGetter:       c.config.Backend.PluginGetter(),
335 336
 	})
336 337
 
337 338
 	if err != nil {
... ...
@@ -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
 }
... ...
@@ -1270,6 +1270,11 @@ func (daemon *Daemon) PluginManager() *plugin.Manager { // set up before daemon
1270 1270
 	return daemon.pluginManager
1271 1271
 }
1272 1272
 
1273
+// PluginGetter returns current pluginStore associated with the daemon
1274
+func (daemon *Daemon) PluginGetter() *plugin.Store {
1275
+	return daemon.PluginStore
1276
+}
1277
+
1273 1278
 // CreateDaemonRoot creates the root for the daemon
1274 1279
 func CreateDaemonRoot(config *Config) error {
1275 1280
 	// get the canonical path to the Docker root directory