From 012bf4129d87110c562db745fc3ad261daac36a2 Mon Sep 17 00:00:00 2001 From: Derek McGowan Date: Mon, 15 Jun 2015 11:06:21 -0700 Subject: [PATCH] Store layer digests on pull Currently digests are not stored on pull, causing a simple re-tag or re-push to send up all layers. Storing the digests on pull will allow subsequent pushes to the same repository to not push up content. This does not address pushing content to a new repository. When content is pushed to a new repository, the digest will be recalculated. Since only one digest is currently stored, it may cause a new content push to the original repository. Fixes #13883 Signed-off-by: Derek McGowan (github: dmcgowan) (cherry picked from commit a98ea87e463383a77d7244c78c9da3ac9f2cd086) --- graph/pull.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/graph/pull.go b/graph/pull.go index c266d0431..fff8a7552 100644 --- a/graph/pull.go +++ b/graph/pull.go @@ -654,6 +654,10 @@ func (s *TagStore) pullV2Tag(r *registry.Session, out io.Writer, endpoint *regis return false, err } + if err := d.img.SaveCheckSum(s.graph.ImageRoot(d.img.ID), d.digest.String()); err != nil { + return false, err + } + // FIXME: Pool release here for parallel tag pull (ensures any downloads block until fully extracted) } out.Write(sf.FormatProgress(stringid.TruncateID(d.img.ID), "Pull complete", nil))