From fa6bdfd96542b2000f22090a689baa3a1de9e8c5 Mon Sep 17 00:00:00 2001 From: Marcus Cobden Date: Mon, 7 Nov 2016 16:50:46 +0000 Subject: [PATCH] Add Image ID & Ref to container commit event Signed-off-by: Marcus Cobden Upstream-commit: e60ae5380208c9329ef8be38fe3f4bdcd8ef6e83 Component: engine --- components/engine/daemon/commit.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/engine/daemon/commit.go b/components/engine/daemon/commit.go index 1e27ccc889..7becc191de 100644 --- a/components/engine/daemon/commit.go +++ b/components/engine/daemon/commit.go @@ -226,6 +226,7 @@ func (daemon *Daemon) Commit(name string, c *backend.ContainerCommitConfig) (str } } + imageRef := "" if c.Repo != "" { newTag, err := reference.WithName(c.Repo) // todo: should move this to API layer if err != nil { @@ -239,10 +240,13 @@ func (daemon *Daemon) Commit(name string, c *backend.ContainerCommitConfig) (str if err := daemon.TagImageWithReference(id, newTag); err != nil { return "", err } + imageRef = newTag.String() } attributes := map[string]string{ "comment": c.Comment, + "imageID": id.String(), + "imageRef": imageRef, } daemon.LogContainerEventWithAttributes(container, "commit", attributes) containerActions.WithValues("commit").UpdateSince(start)