summaryrefslogtreecommitdiff
path: root/libpod/options.go
diff options
context:
space:
mode:
Diffstat (limited to 'libpod/options.go')
-rw-r--r--libpod/options.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/libpod/options.go b/libpod/options.go
index 90b376668..1af788e46 100644
--- a/libpod/options.go
+++ b/libpod/options.go
@@ -180,13 +180,18 @@ 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 {
+func WithHooksDir(hooksDir string, dirNotExistFatal bool) RuntimeOption {
return func(rt *Runtime) error {
if rt.valid {
return ErrRuntimeFinalized
}
+ if hooksDir == "" {
+ return errors.Wrap(ErrInvalidArg, "empty-string hook directories are not supported")
+ }
+
rt.config.HooksDir = hooksDir
+ rt.config.HooksDirNotExistFatal = dirNotExistFatal
return nil
}
}