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

Commit

Permalink
prevent bogus manifest fetching success
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rade committed Jul 24, 2018
1 parent 6420bf7 commit bbade6d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion registry/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (a *Remote) Manifest(ctx context.Context, ref string) (image.Info, error) {

interpret:
if fetchErr != nil {
return image.Info{}, err
return image.Info{}, fetchErr
}

info := image.Info{ID: a.repo.ToRef(ref), Digest: manifestDigest.String()}
Expand Down

0 comments on commit bbade6d

Please sign in to comment.