moby--moby/daemon/graphdriver
Sebastiaan van Stijn 3853eb59d1
daemon: require storage-driver to be set if the driver is deprecated
Previously, we only printed a warning if a storage driver was deprecated. The
intent was to continue supporting these drivers, to allow users to migrate
to a different storage driver.

This patch changes the behavior; if the user has no storage driver specified
in the daemon configuration (so if we try to detect the previous storage
driver based on what's present in /var/lib/docker), we now produce an error,
informing the user that the storage driver is deprecated (and to be removed),
as well as instructing them to change the daemon configuration to explicitly
select the storage driver (to allow them to migrate).

This should make the deprecation more visible; this will be disruptive, but
it's better to have the failure happening *now* (while the drivers are still
there), than for users to discover the storage driver is no longer there
(which would require them to *downgrade* the daemon in order to migrate
to a different driver).

With this change, `docker info` includes a link in the warnings that:

    / # docker info
    Client:
    Context:    default
    Debug Mode: false

    Server:
    ...
    Live Restore Enabled: false

    WARNING: The overlay storage-driver is deprecated, and will be removed in a future release.
    Refer to the documentation for more information: https://docs.docker.com/go/storage-driver/

When starting the daemon without a storage driver configured explicitly, but
previous state was using a deprecated driver, the error is both logged and
printed:

    ...
    ERRO[2022-03-25T14:14:06.032014013Z] [graphdriver] prior storage driver overlay is deprecated and will be removed in a future release; update the the daemon configuration and explicitly choose this storage driver to continue using it; visit https://docs.docker.com/go/storage-driver/ for more information
    ...
    failed to start daemon: error initializing graphdriver: prior storage driver overlay is deprecated and will be removed in a future release; update the the daemon configuration and explicitly choose this storage driver to continue using it; visit https://docs.docker.com/go/storage-driver/ for more information

When starting the daemon and explicitly configuring it with a deprecated storage
driver:

    WARN[2022-03-25T14:15:59.042335412Z] [graphdriver] WARNING: the overlay storage-driver is deprecated and will be removed in a future release; visit https://docs.docker.com/go/storage-driver/ for more information

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-25 15:22:06 +01:00
..
aufs
btrfs
copy
devmapper
fuse-overlayfs
graphtest
overlay
overlay2
overlayutils
register
vfs
windows
zfs
counter.go
driver.go
driver_freebsd.go
driver_linux.go
driver_test.go
driver_unsupported.go
driver_windows.go
errors.go
fsdiff.go
plugin.go
proxy.go
proxy_test.go