From 88fdcfef02cdc8b4fcff10cded6a89a42a360ec1 Mon Sep 17 00:00:00 2001 From: Derek McGowan Date: Wed, 4 Feb 2015 09:21:36 -0800 Subject: [PATCH] Limit push and pull to v2 official registry No longer push to the official v2 registry when it is available. This allows pulling images from the v2 registry without defaulting push. Only pull official images from the v2 official registry. Signed-off-by: Derek McGowan (github: dmcgowan) --- graph/pull.go | 2 +- graph/push.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/graph/pull.go b/graph/pull.go index df00bc868eaf23aa63fadcb6f5013541c6ab6c4d..fd6170b571cc4c552a70e97bd947199317a510e6 100644 --- a/graph/pull.go +++ b/graph/pull.go @@ -72,7 +72,7 @@ func (s *TagStore) CmdPull(job *engine.Job) engine.Status { logName += ":" + tag } - if len(repoInfo.Index.Mirrors) == 0 && (repoInfo.Index.Official || endpoint.Version == registry.APIVersion2) { + if len(repoInfo.Index.Mirrors) == 0 && ((repoInfo.Official && repoInfo.Index.Official) || endpoint.Version == registry.APIVersion2) { j := job.Eng.Job("trust_update_base") if err = j.Run(); err != nil { log.Errorf("error updating trust base graph: %s", err) diff --git a/graph/push.go b/graph/push.go index ff699ee4b862858f6b2b5a57c2757afceb3b5a1e..6ae2d670d6b66f7255542bc6165f93d2e56a8ad1 100644 --- a/graph/push.go +++ b/graph/push.go @@ -455,7 +455,7 @@ func (s *TagStore) CmdPush(job *engine.Job) engine.Status { return job.Error(err2) } - if repoInfo.Index.Official || endpoint.Version == registry.APIVersion2 { + if endpoint.Version == registry.APIVersion2 { err := s.pushV2Repository(r, job.Eng, job.Stdout, repoInfo, tag, sf) if err == nil { return engine.StatusOK