Skip to content

Commit 88fdcfe

Browse files
committed
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 <[email protected]> (github: dmcgowan)
1 parent 989ca9b commit 88fdcfe

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

graph/pull.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func (s *TagStore) CmdPull(job *engine.Job) engine.Status {
7272
logName += ":" + tag
7373
}
7474

75-
if len(repoInfo.Index.Mirrors) == 0 && (repoInfo.Index.Official || endpoint.Version == registry.APIVersion2) {
75+
if len(repoInfo.Index.Mirrors) == 0 && ((repoInfo.Official && repoInfo.Index.Official) || endpoint.Version == registry.APIVersion2) {
7676
j := job.Eng.Job("trust_update_base")
7777
if err = j.Run(); err != nil {
7878
log.Errorf("error updating trust base graph: %s", err)

graph/push.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ func (s *TagStore) CmdPush(job *engine.Job) engine.Status {
455455
return job.Error(err2)
456456
}
457457

458-
if repoInfo.Index.Official || endpoint.Version == registry.APIVersion2 {
458+
if endpoint.Version == registry.APIVersion2 {
459459
err := s.pushV2Repository(r, job.Eng, job.Stdout, repoInfo, tag, sf)
460460
if err == nil {
461461
return engine.StatusOK

0 commit comments

Comments
 (0)