From 51a5cdc6366905cde09e8efb7afa06f51ef9c67b Mon Sep 17 00:00:00 2001 From: umohnani8 Date: Thu, 26 Apr 2018 16:41:06 -0400 Subject: Modify secrets pkg Made a mistake in my earlier patch. I though that if you add an empty string to an array, the length of the array would still be 0... Realised this when vendoring the secrets pkg into cri-o. Signed-off-by: umohnani8 Closes: #685 Approved by: mheon --- libpod/options.go | 5 ++++- libpod/runtime.go | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'libpod') diff --git a/libpod/options.go b/libpod/options.go index 202cfe9a3..981ca9a9d 100644 --- a/libpod/options.go +++ b/libpod/options.go @@ -194,7 +194,10 @@ func WithDefaultMountsFile(mountsFile string) RuntimeOption { return ErrRuntimeFinalized } - rt.config.DefaultMountsFile = []string{mountsFile} + if mountsFile == "" { + return ErrInvalidArg + } + rt.config.DefaultMountsFile = mountsFile return nil } } diff --git a/libpod/runtime.go b/libpod/runtime.go index f46fc8851..9de70da1b 100644 --- a/libpod/runtime.go +++ b/libpod/runtime.go @@ -132,7 +132,7 @@ type RuntimeConfig struct { // HooksDir Path to the directory containing hooks configuration files HooksDir string `toml:"hooks_dir"` // DefaultMountsFile is the path to the default mounts file for testing purposes only - DefaultMountsFile []string `toml:"-"` + DefaultMountsFile string `toml:"-"` } var ( -- cgit v1.2.3-54-g00ecf