Skip to content

Commit c410222

Browse files
committed
move plugins out of experimental
Signed-off-by: Victor Vieux <[email protected]>
1 parent 1e59234 commit c410222

27 files changed

Lines changed: 81 additions & 98 deletions

cli/command/plugin/cmd.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ func NewPluginCommand(dockerCli *command.DockerCli) *cobra.Command {
1616
cmd.SetOutput(dockerCli.Err())
1717
cmd.HelpFunc()(cmd, args)
1818
},
19-
Tags: map[string]string{"experimental": ""},
2019
}
2120

2221
cmd.AddCommand(

client/interface.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ type CommonAPIClient interface {
2121
ImageAPIClient
2222
NodeAPIClient
2323
NetworkAPIClient
24+
PluginAPIClient
2425
ServiceAPIClient
2526
SwarmAPIClient
2627
SecretAPIClient
@@ -104,6 +105,19 @@ type NodeAPIClient interface {
104105
NodeUpdate(ctx context.Context, nodeID string, version swarm.Version, node swarm.NodeSpec) error
105106
}
106107

108+
// PluginAPIClient defines API client methods for the plugins
109+
type PluginAPIClient interface {
110+
PluginList(ctx context.Context) (types.PluginsListResponse, error)
111+
PluginRemove(ctx context.Context, name string, options types.PluginRemoveOptions) error
112+
PluginEnable(ctx context.Context, name string) error
113+
PluginDisable(ctx context.Context, name string) error
114+
PluginInstall(ctx context.Context, name string, options types.PluginInstallOptions) error
115+
PluginPush(ctx context.Context, name string, registryAuth string) error
116+
PluginSet(ctx context.Context, name string, args []string) error
117+
PluginInspectWithRaw(ctx context.Context, name string) (*types.Plugin, []byte, error)
118+
PluginCreate(ctx context.Context, createContext io.Reader, options types.PluginCreateOptions) error
119+
}
120+
107121
// ServiceAPIClient defines API client methods for the services
108122
type ServiceAPIClient interface {
109123
ServiceCreate(ctx context.Context, service swarm.ServiceSpec, options types.ServiceCreateOptions) (types.ServiceCreateResponse, error)

client/interface_experimental.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
package client
22

33
import (
4-
"io"
5-
64
"github.com/docker/docker/api/types"
75
"golang.org/x/net/context"
86
)
97

108
type apiClientExperimental interface {
119
CheckpointAPIClient
12-
PluginAPIClient
1310
}
1411

1512
// CheckpointAPIClient defines API client methods for the checkpoints
@@ -18,16 +15,3 @@ type CheckpointAPIClient interface {
1815
CheckpointDelete(ctx context.Context, container string, options types.CheckpointDeleteOptions) error
1916
CheckpointList(ctx context.Context, container string, options types.CheckpointListOptions) ([]types.Checkpoint, error)
2017
}
21-
22-
// PluginAPIClient defines API client methods for the plugins
23-
type PluginAPIClient interface {
24-
PluginList(ctx context.Context) (types.PluginsListResponse, error)
25-
PluginRemove(ctx context.Context, name string, options types.PluginRemoveOptions) error
26-
PluginEnable(ctx context.Context, name string) error
27-
PluginDisable(ctx context.Context, name string) error
28-
PluginInstall(ctx context.Context, name string, options types.PluginInstallOptions) error
29-
PluginPush(ctx context.Context, name string, registryAuth string) error
30-
PluginSet(ctx context.Context, name string, args []string) error
31-
PluginInspectWithRaw(ctx context.Context, name string) (*types.Plugin, []byte, error)
32-
PluginCreate(ctx context.Context, createContext io.Reader, options types.PluginCreateOptions) error
33-
}

cmd/dockerd/daemon.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
"github.com/docker/docker/api/server/router/container"
2020
"github.com/docker/docker/api/server/router/image"
2121
"github.com/docker/docker/api/server/router/network"
22+
pluginrouter "github.com/docker/docker/api/server/router/plugin"
2223
swarmrouter "github.com/docker/docker/api/server/router/swarm"
2324
systemrouter "github.com/docker/docker/api/server/router/system"
2425
"github.com/docker/docker/api/server/router/volume"
@@ -38,6 +39,7 @@ import (
3839
"github.com/docker/docker/pkg/plugingetter"
3940
"github.com/docker/docker/pkg/signal"
4041
"github.com/docker/docker/pkg/system"
42+
"github.com/docker/docker/plugin"
4143
"github.com/docker/docker/registry"
4244
"github.com/docker/docker/runconfig"
4345
"github.com/docker/docker/utils"
@@ -457,6 +459,7 @@ func initRouter(s *apiserver.Server, d *daemon.Daemon, c *cluster.Cluster) {
457459
volume.NewRouter(d),
458460
build.NewRouter(dockerfile.NewBuildManager(d)),
459461
swarmrouter.NewRouter(d, c),
462+
pluginrouter.NewRouter(plugin.GetManager()),
460463
}...)
461464

462465
if d.NetworkControllerEnabled() {

cmd/dockerd/routes_experimental.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@ import (
44
"github.com/docker/docker/api/server/httputils"
55
"github.com/docker/docker/api/server/router"
66
checkpointrouter "github.com/docker/docker/api/server/router/checkpoint"
7-
pluginrouter "github.com/docker/docker/api/server/router/plugin"
87
"github.com/docker/docker/daemon"
9-
"github.com/docker/docker/plugin"
108
)
119

1210
func addExperimentalRouters(routers []router.Router, d *daemon.Daemon, decoder httputils.ContainerDecoder) []router.Router {
1311
if !d.HasExperimental() {
1412
return []router.Router{}
1513
}
16-
return append(routers, checkpointrouter.NewRouter(d, decoder), pluginrouter.NewRouter(plugin.GetManager()))
14+
return append(routers, checkpointrouter.NewRouter(d, decoder))
1715
}

daemon/daemon.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import (
2929
"github.com/docker/docker/daemon/events"
3030
"github.com/docker/docker/daemon/exec"
3131
"github.com/docker/docker/dockerversion"
32+
"github.com/docker/docker/plugin"
3233
"github.com/docker/libnetwork/cluster"
3334
// register graph drivers
3435
_ "github.com/docker/docker/daemon/graphdriver/register"
@@ -1267,3 +1268,16 @@ func (daemon *Daemon) GetCluster() Cluster {
12671268
func (daemon *Daemon) SetCluster(cluster Cluster) {
12681269
daemon.cluster = cluster
12691270
}
1271+
1272+
func (daemon *Daemon) pluginInit(cfg *Config, remote libcontainerd.Remote) error {
1273+
return plugin.Init(cfg.Root, daemon.PluginStore, remote, daemon.RegistryService, cfg.LiveRestoreEnabled, daemon.LogPluginEvent)
1274+
}
1275+
1276+
func (daemon *Daemon) pluginShutdown() {
1277+
manager := plugin.GetManager()
1278+
// Check for a valid manager object. In error conditions, daemon init can fail
1279+
// and shutdown called, before plugin manager is initialized.
1280+
if manager != nil {
1281+
manager.Shutdown()
1282+
}
1283+
}

daemon/daemon_experimental.go

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,7 @@
11
package daemon
22

3-
import (
4-
"github.com/docker/docker/api/types/container"
5-
"github.com/docker/docker/libcontainerd"
6-
"github.com/docker/docker/plugin"
7-
)
3+
import "github.com/docker/docker/api/types/container"
84

95
func (daemon *Daemon) verifyExperimentalContainerSettings(hostConfig *container.HostConfig, config *container.Config) ([]string, error) {
106
return nil, nil
117
}
12-
13-
func (daemon *Daemon) pluginInit(cfg *Config, remote libcontainerd.Remote) error {
14-
if !daemon.HasExperimental() {
15-
return nil
16-
}
17-
return plugin.Init(cfg.Root, daemon.PluginStore, remote, daemon.RegistryService, cfg.LiveRestoreEnabled, daemon.LogPluginEvent)
18-
}
19-
20-
func (daemon *Daemon) pluginShutdown() {
21-
if !daemon.HasExperimental() {
22-
return
23-
}
24-
manager := plugin.GetManager()
25-
// Check for a valid manager object. In error conditions, daemon init can fail
26-
// and shutdown called, before plugin manager is initialized.
27-
if manager != nil {
28-
manager.Shutdown()
29-
}
30-
}

docs/extend/config.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ aliases: [
55
title: "Plugin config"
66
description: "How develop and use a plugin with the managed plugin system"
77
keywords: "API, Usage, plugins, documentation, developer"
8-
advisory: "experimental"
98
---
109

1110
<!-- This file is maintained within the docker/docker Github
@@ -19,8 +18,8 @@ advisory: "experimental"
1918

2019
# Plugin Config Version 0 of Plugin V2
2120

22-
This document outlines the format of the V0 plugin config. The plugin
23-
config described herein was introduced in the Docker daemon (experimental version) in the [v1.12.0
21+
This document outlines the format of the V0 plugin configuration. The plugin
22+
config described herein was introduced in the Docker daemon in the [v1.12.0
2423
release](https://github.com/docker/docker/commit/f37117045c5398fd3dca8016ea8ca0cb47e7312b).
2524

2625
Plugin configs describe the various constituents of a docker plugin. Plugin
@@ -171,7 +170,6 @@ Config provides the base accessible fields for working with V0 plugin format
171170

172171
```
173172
{
174-
"configVersion": "v0",
175173
"description": "A test plugin for Docker",
176174
"documentation": "https://docs.docker.com/engine/extend/plugins/",
177175
"entrypoint": ["plugin-no-remove", "/data"],

docs/extend/index.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
advisory: experimental
32
aliases:
43
- /engine/extend/
54
description: Develop and use a plugin with the managed plugin system
@@ -18,9 +17,6 @@ title: Managed plugin system
1817

1918
# Docker Engine managed plugin system
2019

21-
This document describes the plugin system available today in the **experimental
22-
build** of Docker 1.12:
23-
2420
* [Installing and using a plugin](index.md#installing-and-using-a-plugin)
2521
* [Developing a plugin](index.md#developing-a-plugin)
2622

docs/extend/legacy_plugins.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ keywords: "Examples, Usage, plugins, docker, documentation, user guide"
1717
# Use Docker Engine plugins
1818

1919
This document describes the Docker Engine plugins generally available in Docker
20-
Engine. To view information on plugins managed by Docker Engine currently in
21-
experimental status, refer to [Docker Engine plugin system](index.md).
20+
Engine. To view information on plugins managed by Docker,
21+
refer to [Docker Engine plugin system](index.md).
2222

2323
You can extend the capabilities of the Docker Engine by loading third-party
2424
plugins. This page explains the types of plugins and provides links to several

0 commit comments

Comments
 (0)