From cec0e2dfbddac0bf1362cfbfc94d8d4003c7da36 Mon Sep 17 00:00:00 2001 From: Qiang Huang Date: Mon, 5 Sep 2016 15:02:14 +0800 Subject: [PATCH] Cleanup pullSchema2 Signed-off-by: Qiang Huang --- distribution/pull_v2.go | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/distribution/pull_v2.go b/distribution/pull_v2.go index 958f1bf3fc..3cd8d33aae 100644 --- a/distribution/pull_v2.go +++ b/distribution/pull_v2.go @@ -559,10 +559,6 @@ func (p *v2Puller) pullSchema2(ctx context.Context, ref reference.Named, mfst *s rootFS, release, err := p.config.DownloadManager.Download(ctx, downloadRootFS, descriptors, p.config.ProgressOutput) if err != nil { - if configJSON != nil { - // Already received the config - return "", "", err - } select { case err = <-errChan: return "", "", err @@ -577,11 +573,9 @@ func (p *v2Puller) pullSchema2(ctx context.Context, ref reference.Named, mfst *s } defer release() - if configJSON == nil { - configJSON, unmarshalledConfig, err = receiveConfig(configChan, errChan) - if err != nil { - return "", "", err - } + configJSON, unmarshalledConfig, err = receiveConfig(configChan, errChan) + if err != nil { + return "", "", err } if unmarshalledConfig.RootFS == nil {