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:
@@ -5,6 +5,7 @@ import (
|
||||
"fmt"
|
||||
|
||||
"github.com/containerd/containerd/log"
|
||||
"github.com/docker/docker/api/types/events"
|
||||
"github.com/docker/docker/container"
|
||||
)
|
||||
|
||||
@@ -46,7 +47,7 @@ func (daemon *Daemon) containerPause(container *container.Container) error {
|
||||
container.Paused = true
|
||||
daemon.setStateCounter(container)
|
||||
daemon.updateHealthMonitor(container)
|
||||
daemon.LogContainerEvent(container, "pause")
|
||||
daemon.LogContainerEvent(container, events.ActionPause)
|
||||
|
||||
if err := container.CheckpointTo(daemon.containersReplica); err != nil {
|
||||
log.G(context.TODO()).WithError(err).Warn("could not save container to disk")
|
||||
|
||||
Reference in New Issue
Block a user