From 0c08913d523da2a935e65ade93884194c1906991 Mon Sep 17 00:00:00 2001 From: Tonis Tiigi Date: Fri, 21 Aug 2015 10:28:35 -0700 Subject: [PATCH] Remove nil contexts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Causes daemon panic because loggers can’t be found. Fixes #15724 Signed-off-by: Tonis Tiigi --- graph/pull_v2.go | 6 +++--- graph/push_v2.go | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/graph/pull_v2.go b/graph/pull_v2.go index daf906b98a..aa58ed395f 100644 --- a/graph/pull_v2.go +++ b/graph/pull_v2.go @@ -141,9 +141,9 @@ func (p *v2Puller) download(di *downloadInfo) { } di.tmpFile = tmpFile - blobs := p.repo.Blobs(nil) + blobs := p.repo.Blobs(context.Background()) - desc, err := blobs.Stat(nil, di.digest) + desc, err := blobs.Stat(context.Background(), di.digest) if err != nil { logrus.Debugf("Error statting layer: %v", err) di.err <- err @@ -151,7 +151,7 @@ func (p *v2Puller) download(di *downloadInfo) { } di.size = desc.Size - layerDownload, err := blobs.Open(nil, di.digest) + layerDownload, err := blobs.Open(context.Background(), di.digest) if err != nil { logrus.Debugf("Error fetching layer: %v", err) di.err <- err diff --git a/graph/push_v2.go b/graph/push_v2.go index da90ebf6d2..2df1d12315 100644 --- a/graph/push_v2.go +++ b/graph/push_v2.go @@ -138,7 +138,7 @@ func (p *v2Pusher) pushV2Tag(tag string) error { dgst, err := p.graph.GetDigest(layer.ID) switch err { case nil: - _, err := p.repo.Blobs(nil).Stat(nil, dgst) + _, err := p.repo.Blobs(context.Background()).Stat(context.Background(), dgst) switch err { case nil: exists = true @@ -158,7 +158,7 @@ func (p *v2Pusher) pushV2Tag(tag string) error { // if digest was empty or not saved, or if blob does not exist on the remote repository, // then fetch it. if !exists { - if pushDigest, err := p.pushV2Image(p.repo.Blobs(nil), layer); err != nil { + if pushDigest, err := p.pushV2Image(p.repo.Blobs(context.Background()), layer); err != nil { return err } else if pushDigest != dgst { // Cache new checksum @@ -226,7 +226,7 @@ func (p *v2Pusher) pushV2Image(bs distribution.BlobService, img *image.Image) (d // Send the layer logrus.Debugf("rendered layer for %s of [%d] size", img.ID, size) - layerUpload, err := bs.Create(nil) + layerUpload, err := bs.Create(context.Background()) if err != nil { return "", err } @@ -250,7 +250,7 @@ func (p *v2Pusher) pushV2Image(bs distribution.BlobService, img *image.Image) (d } desc := distribution.Descriptor{Digest: dgst} - if _, err := layerUpload.Commit(nil, desc); err != nil { + if _, err := layerUpload.Commit(context.Background(), desc); err != nil { return "", err }