daemon: Fix forceful switch to containerd image store

When no explicit driver was specified, the containerd store by default
was also applied to existing graphdriver setups.

Fix this and add a test.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
Paweł Gronowski
2025-08-18 15:22:17 +02:00
parent 0476bb6d55
commit 555e3939c9
3 changed files with 79 additions and 0 deletions

View File

@@ -861,6 +861,11 @@ func NewDaemon(ctx context.Context, config *config.Config, pluginStore *plugin.S
migrationThreshold := int64(-1)
isGraphDriver := func(driver string) (bool, error) {
if driver == "" {
if graphdriver.HasPriorDriver(config.Root) {
return true, nil
}
}
return graphdriver.IsRegistered(driver), nil
}
if enabled, ok := config.Features["containerd-snapshotter"]; (ok && !enabled) || os.Getenv("TEST_INTEGRATION_USE_GRAPHDRIVER") != "" {