summaryrefslogtreecommitdiff
path: root/libpod/options.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2018-12-04 12:19:48 -0800
committerGitHub <noreply@github.com>2018-12-04 12:19:48 -0800
commitb81f640bb5a821a1f44b6899a01d9523a38ec351 (patch)
treec2e95941146437198d5a02ee8d6fc4df94f076a8 /libpod/options.go
parenta01a590ae8ea817ff38c30cf4b534c17584aaec2 (diff)
parenta4b483c8484bb6fb9ae487264bccc663f007e711 (diff)
downloadpodman-b81f640bb5a821a1f44b6899a01d9523a38ec351.tar.gz
podman-b81f640bb5a821a1f44b6899a01d9523a38ec351.tar.bz2
podman-b81f640bb5a821a1f44b6899a01d9523a38ec351.zip
Merge pull request #1920 from wking/explicit-hooks-dirs
libpod/container_internal: Deprecate implicit hook directories
Diffstat (limited to 'libpod/options.go')
-rw-r--r--libpod/options.go15
1 files changed, 7 insertions, 8 deletions
diff --git a/libpod/options.go b/libpod/options.go
index 7f4e3ac6b..e1d0b5007 100644
--- a/libpod/options.go
+++ b/libpod/options.go
@@ -179,21 +179,20 @@ func WithStaticDir(dir string) RuntimeOption {
}
}
-// WithHooksDir sets the directory to look for OCI runtime hooks config.
-// Note we are not saving this in database, since this is really just for used
-// for testing.
-func WithHooksDir(hooksDir string) RuntimeOption {
+// WithHooksDir sets the directories to look for OCI runtime hook configuration.
+func WithHooksDir(hooksDirs ...string) RuntimeOption {
return func(rt *Runtime) error {
if rt.valid {
return ErrRuntimeFinalized
}
- if hooksDir == "" {
- return errors.Wrap(ErrInvalidArg, "empty-string hook directories are not supported")
+ for _, hooksDir := range hooksDirs {
+ if hooksDir == "" {
+ return errors.Wrap(ErrInvalidArg, "empty-string hook directories are not supported")
+ }
}
- rt.config.HooksDir = []string{hooksDir}
- rt.config.HooksDirNotExistFatal = true
+ rt.config.HooksDir = hooksDirs
return nil
}
}