Files
moby/internal
Cory Snider 7f065ad76f libnetwork: take the store from the caller
libnetwork opens its BoltDB database, local-kv.db, in a data directory
that its caller sets. Nothing else in libnetwork uses the data
directory.

Have the caller open the store and pass it in as a kvstore.Store with
config.WithKVStore. The caller owns the store: Controller.Stop leaves
it open, and neither kvstore.Store nor datastore.Store has a Close
method. A controller created without a store keeps its state in a
memstore, which is all most tests need. The daemon opens the store at
the same path as before, <data-root>/network/files/local-kv.db, and
closes it after stopping the controller.

Remove OptionDataDir, and the option to name the store's bucket, which
was only used by tests.

Assisted-By: Claude Opus 5.5
Signed-off-by: Cory Snider <csnider@mirantis.com>
2026-10-02 16:31:27 -04:00
..