From 3be4551a9164c5fac577e9e3683dea65c2fc193a Mon Sep 17 00:00:00 2001 From: Derek McGowan Date: Tue, 7 Oct 2014 11:00:17 -0700 Subject: [PATCH] Enable V2 pull flow Signed-off-by: Derek McGowan (github: dmcgowan) --- graph/pull.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/graph/pull.go b/graph/pull.go index 327716a2f2..5d7e84ed72 100644 --- a/graph/pull.go +++ b/graph/pull.go @@ -137,6 +137,19 @@ func (s *TagStore) CmdPull(job *engine.Job) engine.Status { mirrors = s.mirrors } + if isOfficial || endpoint.Version == registry.APIVersion2 { + j := job.Eng.Job("trust_update_base") + if err = j.Run(); err != nil { + return job.Errorf("error updating trust base graph: %s", err) + } + + if err := s.pullV2Repository(job.Eng, r, job.Stdout, localName, remoteName, tag, sf, job.GetenvBool("parallel")); err == nil { + return engine.StatusOK + } else if err != registry.ErrDoesNotExist { + log.Errorf("Error from V2 registry: %s", err) + } + } + if err = s.pullRepository(r, job.Stdout, localName, remoteName, tag, sf, job.GetenvBool("parallel"), mirrors); err != nil { return job.Error(err) }