mirror of https://github.com/containers/podman.git
Update hooks to use config bool to detect volume mounts
Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #700 Approved by: rhatdan
This commit is contained in:
parent
7137ca81d9
commit
1ece5d3db7
|
@ -1125,6 +1125,7 @@ func (c *Container) saveSpec(spec *spec.Spec) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add OCI hooks to a container's spec
|
||||||
func (c *Container) setupOCIHooks(g *generate.Generator) error {
|
func (c *Container) setupOCIHooks(g *generate.Generator) error {
|
||||||
addedHooks := map[string]struct{}{}
|
addedHooks := map[string]struct{}{}
|
||||||
ocihooks, err := hooks.SetupHooks(c.runtime.config.HooksDir)
|
ocihooks, err := hooks.SetupHooks(c.runtime.config.HooksDir)
|
||||||
|
@ -1143,7 +1144,7 @@ func (c *Container) setupOCIHooks(g *generate.Generator) error {
|
||||||
}
|
}
|
||||||
for _, hook := range ocihooks {
|
for _, hook := range ocihooks {
|
||||||
logrus.Debugf("SetupOCIHooks", hook)
|
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 {
|
if err := addHook(hook); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue