diff options
author | Matthew Heon <matthew.heon@gmail.com> | 2018-04-30 11:58:02 -0400 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-05-03 12:23:12 +0000 |
commit | 1ece5d3db710abb36b36e081d55ffcf7441bc211 (patch) | |
tree | 7d7b5f882cfcc48e68e426b06d194ad013dba764 | |
parent | 7137ca81d988309ca4f71bffa650f8bfd78ac713 (diff) | |
download | podman-1ece5d3db710abb36b36e081d55ffcf7441bc211.tar.gz podman-1ece5d3db710abb36b36e081d55ffcf7441bc211.tar.bz2 podman-1ece5d3db710abb36b36e081d55ffcf7441bc211.zip |
Update hooks to use config bool to detect volume mounts
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Closes: #700
Approved by: rhatdan
-rw-r--r-- | libpod/container_internal.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go index 740824e1b..7631b80e8 100644 --- a/libpod/container_internal.go +++ b/libpod/container_internal.go @@ -1125,6 +1125,7 @@ func (c *Container) saveSpec(spec *spec.Spec) error { return nil } +// Add OCI hooks to a container's spec func (c *Container) setupOCIHooks(g *generate.Generator) error { addedHooks := map[string]struct{}{} ocihooks, err := hooks.SetupHooks(c.runtime.config.HooksDir) @@ -1143,7 +1144,7 @@ func (c *Container) setupOCIHooks(g *generate.Generator) error { } for _, hook := range ocihooks { logrus.Debugf("SetupOCIHooks", hook) - if hook.HasBindMounts && len(c.config.Spec.Mounts) > 0 { + if hook.HasBindMounts && c.config.UserVolumes { if err := addHook(hook); err != nil { return err } |