mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
api/types/events: define "Action" type and consts
Define consts for the Actions we use for events, instead of "ad-hoc" strings. Having these consts makes it easier to find where specific events are triggered, makes the events less error-prone, and allows documenting each Action (if needed). Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/docker/docker/api/types/events"
|
||||
mounttypes "github.com/docker/docker/api/types/mount"
|
||||
"github.com/docker/docker/container"
|
||||
volumemounts "github.com/docker/docker/volume/mounts"
|
||||
@@ -73,7 +74,7 @@ func (daemon *Daemon) setupMounts(c *container.Container) ([]container.Mount, er
|
||||
mnt.ReadOnlyForceRecursive = m.Spec.BindOptions.ReadOnlyForceRecursive
|
||||
}
|
||||
if m.Volume != nil {
|
||||
daemon.LogVolumeEvent(m.Volume.Name(), "mount", map[string]string{
|
||||
daemon.LogVolumeEvent(m.Volume.Name(), events.ActionMount, map[string]string{
|
||||
"driver": m.Volume.DriverName(),
|
||||
"container": c.ID,
|
||||
"destination": m.Destination,
|
||||
|
||||
Reference in New Issue
Block a user