From 131865d1d78fbe0a84ef1c36b4c8cc63cef7d3f3 Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Fri, 4 Dec 2020 09:36:25 -0500 Subject: [PATCH] Add a volume plugins field to containers.conf We decided that making users explicitly list plugins they wanted to use was not a bad thing, and greatly simplifies our implementation. As such, we need a place to do that, and `containers.conf` is the logical location. Signed-off-by: Matthew Heon --- docs/containers.conf.5.md | 7 +++++++ pkg/config/config.go | 6 ++++++ pkg/config/containers.conf | 9 ++++++--- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/docs/containers.conf.5.md b/docs/containers.conf.5.md index 33c700048..5836ee763 100644 --- a/docs/containers.conf.5.md +++ b/docs/containers.conf.5.md @@ -475,6 +475,13 @@ By default this will be configured relative to where containers/storage store containers. This convention is followed by the default volume driver, but may not be by other drivers. +**[engine.volume_plugins]** + +A table of all the enabled volume plugins on the system. Volume plugins can be +used as the backend for Podman named volumes. Individual plugins are specified +below, as a map of the plugin name (what the plugin will be called) to its path +(filepath of the plugin's unix socket). + # FILES **containers.conf** diff --git a/pkg/config/config.go b/pkg/config/config.go index 6a44d353a..3db987751 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -363,6 +363,12 @@ type EngineConfig struct { // under. This convention is followed by the default volume driver, but // may not be by other drivers. VolumePath string `toml:"volume_path,omitempty"` + + // VolumePlugins is a set of plugins that can be used as the backend for + // Podman named volumes. Each volume is specified as a name (what Podman + // will refer to the plugin as) mapped to a path, which must point to a + // Unix socket that conforms to the Volume Plugin specification. + VolumePlugins map[string]string `toml:"volume_plugins,omitempty"` } // SetOptions contains a subset of options in a Config. It's used to indicate if diff --git a/pkg/config/containers.conf b/pkg/config/containers.conf index 5b5d3f9b6..a069d544c 100644 --- a/pkg/config/containers.conf +++ b/pkg/config/containers.conf @@ -458,8 +458,11 @@ default_sysctls = [ # "/usr/bin/kata-fc", # ] -# The [engine.runtimes] table MUST be the last entry in this file. +[engine.volume_plugins] +# testplugin = "/run/podman/plugins/test.sock" + +# The [engine.volume_plugins] table MUST be the last entry in this file. # (Unless another table is added) # TOML does not provide a way to end a table other than a further table being -# defined, so every key hereafter will be part of [runtimes] and not the main -# config. +# defined, so every key hereafter will be part of [volume_plugins] and not the +# main config.