daemon: inline some variables when emitting events

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2023-08-26 18:25:27 +02:00
parent 8d404ac408
commit 10a3a3bc49
8 changed files with 22 additions and 37 deletions

View File

@@ -73,14 +73,13 @@ func (daemon *Daemon) setupMounts(c *container.Container) ([]container.Mount, er
mnt.ReadOnlyForceRecursive = m.Spec.BindOptions.ReadOnlyForceRecursive
}
if m.Volume != nil {
attributes := map[string]string{
daemon.LogVolumeEvent(m.Volume.Name(), "mount", map[string]string{
"driver": m.Volume.DriverName(),
"container": c.ID,
"destination": m.Destination,
"read/write": strconv.FormatBool(m.RW),
"propagation": string(m.Propagation),
}
daemon.LogVolumeEvent(m.Volume.Name(), "mount", attributes)
})
}
mounts = append(mounts, mnt)
}