From 6ac8a24db4ab3e2bbc85feca2bee8cb1c868c7f6 Mon Sep 17 00:00:00 2001 From: umohnani8 Date: Thu, 26 Apr 2018 11:29:02 -0400 Subject: Add --default-mounts-file hidden flag The hidden flag is used to override the path of the default mounts file for testing purposes. Also modified the secrets pkg to allow for this override to happen. Signed-off-by: umohnani8 Closes: #678 Approved by: mheon --- libpod/options.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'libpod/options.go') diff --git a/libpod/options.go b/libpod/options.go index 2c51b5834..202cfe9a3 100644 --- a/libpod/options.go +++ b/libpod/options.go @@ -186,6 +186,19 @@ func WithHooksDir(hooksDir string) RuntimeOption { } } +// WithDefaultMountsFile sets the file to look at for default mounts (mainly secrets) +// Note we are not saving this in the database as it is for testing purposes only +func WithDefaultMountsFile(mountsFile string) RuntimeOption { + return func(rt *Runtime) error { + if rt.valid { + return ErrRuntimeFinalized + } + + rt.config.DefaultMountsFile = []string{mountsFile} + return nil + } +} + // WithTmpDir sets the directory that temporary runtime files which are not // expected to survive across reboots will be stored // This should be located on a tmpfs mount (/tmp or /var/run for example) -- cgit v1.2.3-54-g00ecf