Add volume events.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 9d12d093009d3c4bf3bd4ebad3f8327c36d2d584
Component: engine
This commit is contained in:
David Calavera
2015-12-30 17:39:33 -05:00
parent 3580481051
commit e54bb2b509
12 changed files with 88 additions and 49 deletions
@@ -618,7 +618,7 @@ func detachMounted(path string) error {
}
// UnmountVolumes unmounts all volumes
func (container *Container) UnmountVolumes(forceSyscall bool) error {
func (container *Container) UnmountVolumes(forceSyscall bool, volumeEventLog func(name, action string, attributes map[string]string)) error {
var (
volumeMounts []volume.MountPoint
err error
@@ -649,6 +649,12 @@ func (container *Container) UnmountVolumes(forceSyscall bool) error {
if err := volumeMount.Volume.Unmount(); err != nil {
return err
}
attributes := map[string]string{
"driver": volumeMount.Volume.DriverName(),
"container": container.ID,
}
volumeEventLog(volumeMount.Volume.Name(), "unmount", attributes)
}
}
@@ -39,7 +39,7 @@ func (container *Container) IpcMounts() []execdriver.Mount {
}
// UnmountVolumes explicitly unmounts volumes from the container.
func (container *Container) UnmountVolumes(forceSyscall bool) error {
func (container *Container) UnmountVolumes(forceSyscall bool, volumeEventLog func(name, action string, attributes map[string]string)) error {
return nil
}