From 20b5bfc9b40b4ea75da6e3382933e5698e959ac2 Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Tue, 24 Jul 2018 23:17:49 +0100 Subject: [PATCH] *actually* skip image update on zero CreatedAt We got that slightly wrong in #1249. --- daemon/images.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/daemon/images.go b/daemon/images.go index c0e9624e5..e8f8592cd 100644 --- a/daemon/images.go +++ b/daemon/images.go @@ -55,8 +55,6 @@ func (d *Daemon) pollForNewImages(logger log.Logger) { logger.Log("warning", "untagged image in available images", "action", "skip container") continue containers } - newImage := currentImageID.WithNewTag(latest.ID.Tag) - changes.Add(service.ID, container, newImage) currentCreatedAt := "" for _, info := range filteredImages { if info.CreatedAt.IsZero() { @@ -71,6 +69,8 @@ func (d *Daemon) pollForNewImages(logger log.Logger) { currentCreatedAt = "filtered out or missing" logger.Log("warning", "current image not in filtered images", "action", "proceed anyway") } + newImage := currentImageID.WithNewTag(latest.ID.Tag) + changes.Add(service.ID, container, newImage) logger.Log("info", "added update to automation run", "new", newImage, "reason", fmt.Sprintf("latest %s (%s) > current %s (%s)", latest.ID.Tag, latest.CreatedAt, currentImageID.Tag, currentCreatedAt)) } }