Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Be more explicit and concise during automation run #1249

Merged
merged 2 commits into from
Jul 24, 2018

Conversation

squaremo
Copy link
Member

  • say why an image was added for updating
  • add another safeguard against dubious updates -- check the image
    creation date is not zero
  • don't bother logging when nothing happens

Not intended to cl0se #1127, but may give us more information about what it think it's doing, if it does it again.

 - say why an image was added for updating
 - add another safeguard against dubious updates -- check the image
   creation date is not zero
 - don't bother logging when nothing happens
@squaremo
Copy link
Member Author

@rade points out that this won't avoid the situation where the image that would otherwise be considered the latest gets shuffled to the end of the list through having a zero timestamp.

if err != nil {
logger.Log("error", err)
continue
}

This comment was marked as abuse.

This comment was marked as abuse.

daemon/images.go Outdated
logger.Log("warning", "untagged image in available images", "action", "skip")
continue
}
if latest.CreatedAt.IsZero() {

This comment was marked as abuse.

This comment was marked as abuse.

Since we'd expect an image with a zero timestamp to be shuffled to the
end of the list, we probably won't hit the safeguard just put in,
which checks whether the latest image has a zero timestamp. Instead,
while we're looking for the current image so we can log the
comparison, also check if _any_ images have a zero timestamp, and skip
that container if they do.

Ideally we'd avoid having data with this problem in the first place,
but let's have defence in depth.
@squaremo
Copy link
Member Author

@rade Now checks all the images for a zero timestamp, and skips if it finds one. Care to take a quick look again?

@squaremo squaremo merged commit 6420bf7 into master Jul 24, 2018
@squaremo
Copy link
Member Author

Thanks! 👾

@squaremo squaremo deleted the issue/1127-log-automation-reason branch July 24, 2018 14:53
rade added a commit that referenced this pull request Jul 24, 2018
rade added a commit that referenced this pull request Jul 24, 2018
An error while fetching an image manifest would return a nil
error (hence indicating success) with a unit value image.Info{}
struct.

That is bad news for the caller in Warmer.warm(), which will map an
image tag to that empty image.Info{}, polluting the cache entry for
the image+tag and image in memcached.

When we subsequently use this info to determine the latest suitable
tag, we encounter zero CreatedAt timestamps, which, prior to the
changes in #1247, #1249 and #1250 would cause the wrong images to be
released.

Fixes #1127.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants