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:
@@ -10,6 +10,7 @@ import (
|
||||
"github.com/docker/distribution/reference"
|
||||
"github.com/docker/docker/api/types/backend"
|
||||
containertypes "github.com/docker/docker/api/types/container"
|
||||
"github.com/docker/docker/api/types/events"
|
||||
"github.com/docker/docker/builder/dockerfile"
|
||||
"github.com/docker/docker/errdefs"
|
||||
"github.com/pkg/errors"
|
||||
@@ -180,7 +181,7 @@ func (daemon *Daemon) CreateImageFromContainer(ctx context.Context, name string,
|
||||
}
|
||||
imageRef = reference.FamiliarString(c.Tag)
|
||||
}
|
||||
daemon.LogContainerEventWithAttributes(container, "commit", map[string]string{
|
||||
daemon.LogContainerEventWithAttributes(container, events.ActionCommit, map[string]string{
|
||||
"comment": c.Comment,
|
||||
"imageID": id.String(),
|
||||
"imageRef": imageRef,
|
||||
|
||||
Reference in New Issue
Block a user