Skip to content

Commit

Permalink
Merge pull request moby#48050 from thaJeztah/deprecate_graphdriver_pl…
Browse files Browse the repository at this point in the history
…ugins

deprecate experimental Graphdriver plugins, and disable by default
  • Loading branch information
vvoland authored Jun 21, 2024
2 parents 81b2027 + 6da604a commit ff1e2c0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions daemon/graphdriver/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package graphdriver // import "github.com/docker/docker/daemon/graphdriver"

import (
"fmt"
"os"
"path/filepath"

"github.com/docker/docker/errdefs"
Expand All @@ -12,6 +13,9 @@ import (
)

func lookupPlugin(name string, pg plugingetter.PluginGetter, config Options) (Driver, error) {
if os.Getenv("DOCKERD_DEPRECATED_GRAPHDRIVER_PLUGINS") == "" {
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/")
}
if !config.ExperimentalEnabled {
return nil, fmt.Errorf("graphdriver plugins are only supported with experimental mode")
}
Expand Down
12 changes: 6 additions & 6 deletions integration/plugin/graphdriver/external_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func TestExternalGraphDriver(t *testing.T) {
sserver := setupPluginViaSpecFile(t, ec)
jserver := setupPluginViaJSONFile(t, ec)
// Create daemon
d := daemon.New(t, daemon.WithExperimental())
d := daemon.New(t, daemon.WithExperimental(), daemon.WithEnvVars("DOCKERD_DEPRECATED_GRAPHDRIVER_PLUGINS=1"))
c := d.NewClientT(t)

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

ctx := testutil.StartSpan(baseContext, t)

d := daemon.New(t, daemon.WithExperimental())
d := daemon.New(t, daemon.WithExperimental(), daemon.WithEnvVars("DOCKERD_DEPRECATED_GRAPHDRIVER_PLUGINS=1"))
d.Start(t)
defer d.Stop(t)

client := d.NewClientT(t)
defer client.Close()
apiClient := d.NewClientT(t)
defer apiClient.Close()

// install the plugin
plugin := "cpuguy83/docker-overlay2-graphdriver-plugin"
responseReader, err := client.PluginInstall(ctx, plugin, types.PluginInstallOptions{
responseReader, err := apiClient.PluginInstall(ctx, plugin, types.PluginInstallOptions{
RemoteRef: plugin,
AcceptAllPermissions: true,
})
Expand All @@ -441,7 +441,7 @@ func TestGraphdriverPluginV2(t *testing.T) {
d.Stop(t)
d.StartWithBusybox(ctx, t, "-s", plugin)

testGraphDriver(ctx, t, client, plugin, nil)
testGraphDriver(ctx, t, apiClient, plugin, nil)
}

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

0 comments on commit ff1e2c0

Please sign in to comment.