10000 deprecate experimental Graphdriver plugins, and disable by default · moby/moby@6da604a · GitHub
[go: up one dir, main page]

Skip to content

Commit 6da604a

Browse files
committed
deprecate experimental Graphdriver plugins, and disable by default
Graphdriver plugins] are an experimental feature that allow extending the Docker Engine with custom storage drivers for storing images and containers. This feature was not maintained since its inception, and will no longer be supported in upcoming releases. Users of this feature are recommended to instead configure the Docker Engine to use the [containerd image store], and a custom [snapshotter]. This patch: - Disables loading graphdriver plugins by default, producing an error instead. - Introduces a temporary `DOCKERD_DEPRECATED_GRAPHDRIVER_PLUGINS` environment variable to re-enable the deprecated features; this allows users to still use the feature on a v27.0 daemon, but disabling it by default will give a strong message that it will no longer be supported. [Graphdriver plugins]: https://github.com/docker/cli/blob/v26.1.4/docs/extend/plugins_graphdriver.md [containerd image store]: https://docs.docker.com/storage/containerd/ [snapshotter]: https://github.com/containerd/containerd/tree/v1.7.18/docs/snapshotters Before this patch (ignore the "Unable to load plugin" errors, as there's no plugin); dockerd --experimental -s my-driver ... INFO[2024-06-21T10:42:49.574901255Z] containerd successfully booted in 0.011384s INFO[2024-06-21T10:42:50.575891922Z] [graphdriver] trying configured driver: my-driver WARN[2024-06-21T10:42:50.576121547Z] Unable to locate plugin: my-driver, retrying in 1s WARN[2024-06-21T10:42:51.577131506Z] Unable to locate plugin: my-driver, retrying in 2s WARN[2024-06-21T10:42:53.582637715Z] Unable to locate plugin: my-driver, retrying in 4s With this patch: dockerd --experimental -s my-driver ... INFO[2024-06-21T10:32:35.123078845Z] [graphdriver] trying configured driver: my-driver ERRO[2024-06-21T10:32:35.123127012Z] Failed to GetDriver graph driver=my-driver error="DEPRECATED: Experimental graphdriver plugins are deprecated, and disabled by default. This feature will be removed in the next release. See https://docs.docker.com/go/deprecated/" home-dir=/var/lib/docker INFO[2024-06-21T10:32:35.124735595Z] stopping healthcheck following graceful shutdown module=libcontainerd INFO[2024-06-21T10:32:35.124743137Z] stopping event stream following graceful shutdown error="context canceled" module=libcontainerd namespace=plugins.moby failed to start daemon: error initializing graphdriver: driver not supported: my-driver With the `DOCKERD_DEPRECATED_GRAPHDRIVER_PLUGINS` env-var set: DOCKERD_DEPRECATED_GRAPHDRIVER_PLUGINS=1 dockerd --experimental -s my-driver ... INFO[2024-06-21T10:35:04.149901970Z] containerd successfully booted in 0.013614s INFO[2024-06-21T10:35:05.148195845Z] [graphdriver] trying configured driver: my-driver WARN[2024-06-21T10:35:05.150647679Z] Unable to locate plugin: my-driver, retrying in 1s WARN[2024-06-21T10:35:06.152531221Z] Unable to locate plugin: my-driver, retrying in 2s WARN[2024-06-21T10:35:08.158452389Z] Unable to locate plugin: my-driver, retrying in 4s WARN[2024-06-21T10:35:12.163699293Z] Unable to locate plugin: my-driver, retrying in 8s Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 81b2027 commit 6da604a

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

daemon/graphdriver/plugin.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package graphdriver // import "github.com/docker/docker/daemon/graphdriver"
22

33
import (
44
"fmt"
5+
"os"
56
"path/filepath"
67

78
"github.com/docker/docker/errdefs"
@@ -12,6 +13,9 @@ import (
1213
)
1314

1415
func lookupPlugin(name string, pg plugingetter.PluginGetter, config Options) (Driver, error) {
16+
if os.Getenv("DOCKERD_DEPRECATED_GRAPHDRIVER_PLUGINS") == "" {
17+
return nil, fmt.Errorf("DEPRECATED: Experimental graphdriver plugins are deprecated, and disabled by default. This feature will be removed in the next release. See https://docs.docker.com/go/deprecated/")
18+
}
1519
if !config.ExperimentalEnabled {
1620
return nil, fmt.Errorf("graphdriver plugins are only supported with experimental mode")
1721
}

integration/plugin/graphdriver/external_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func TestExternalGraphDriver(t *testing.T) {
6060
sserver := setupPluginViaSpecFile(t, ec)
6161
jserver := setupPluginViaJSONFile(t, ec)
6262
// Create daemon
63-
d := daemon.New(t, daemon.WithExperimental())
63+
d := daemon.New(t, daemon.WithExperimental(), daemon.WithEnvVars("DOCKERD_DEPRECATED_GRAPHDRIVER_PLUGINS=1"))
6464
c := d.NewClientT(t)
6565

6666
for _, tc := range []struct {
@@ -418,16 +418,16 @@ func TestGraphdriverPluginV2(t *testing.T) {
418418

419419
ctx := testutil.StartSpan(baseContext, t)
420420

421-
d := daemon.New(t, daemon.WithExperimental())
421+
d := daemon.New(t, daemon.WithExperimental(), daemon.WithEnvVars("DOCKERD_DEPRECATED_GRAPHDRIVER_PLUGINS=1"))
422422
d.Start(t)
423423
defer d.Stop(t)
424424

425-
client := d.NewClientT(t)
426-
defer client.Close()
425+
apiClient := d.NewClientT(t)
426+
defer apiClient.Close()
427427

428428
// install the plugin
429429
plugin := "cpuguy83/docker-overlay2-graphdriver-plugin"
430-
responseReader, err := client.PluginInstall(ctx, plugin, types.PluginInstallOptions{
430+
responseReader, err := apiClient.PluginInstall(ctx, plugin, types.PluginInstallOptions{
431431
RemoteRef: plugin,
432432
AcceptAllPermissions: true,
433433
})
@@ -441,7 +441,7 @@ func TestGraphdriverPluginV2(t *testing.T) {
441441
d.Stop(t)
442442
d.StartWithBusybox(ctx, t, "-s", plugin)
443443

444-
testGraphDriver(ctx, t, client, plugin, nil)
444+
testGraphDriver(ctx, t, apiClient, plugin, nil)
445445
}
446446

447447
func testGraphDriver(ctx context.Context, t *testing.T, c client.APIClient, driverName string, afterContainerRunFn func(*testing.T)) {

0 commit comments

Comments
 (0)
0