mirror of
https://github.com/moby/moby.git
synced 2026-08-02 22:26:52 +00:00
Merge pull request #48050 from thaJeztah/deprecate_graphdriver_plugins
deprecate experimental Graphdriver plugins, and disable by default
This commit is contained in:
@@ -2,6 +2,7 @@ package graphdriver // import "github.com/docker/docker/daemon/graphdriver"
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/docker/docker/errdefs"
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
@@ -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,
|
||||
})
|
||||
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user