Browse code

Remove session backup

The v2 session code will no longer update the indexEndpoint value, therefore it is not necessary to save and restore the value for use with v1.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)

Derek McGowan authored on 2015/01/15 10:14:14
Showing 1 changed files
... ...
@@ -72,10 +72,6 @@ func (s *TagStore) CmdPull(job *engine.Job) engine.Status {
72 72
 		logName += ":" + tag
73 73
 	}
74 74
 
75
-	// Calling the v2 code path might change the session
76
-	// endpoint value, so save the original one!
77
-	originalSession := *r
78
-
79 75
 	if len(repoInfo.Index.Mirrors) == 0 && (repoInfo.Index.Official || endpoint.Version == registry.APIVersion2) {
80 76
 		j := job.Eng.Job("trust_update_base")
81 77
 		if err = j.Run(); err != nil {
... ...
@@ -95,8 +91,6 @@ func (s *TagStore) CmdPull(job *engine.Job) engine.Status {
95 95
 		log.Debug("image does not exist on v2 registry, falling back to v1")
96 96
 	}
97 97
 
98
-	r = &originalSession
99
-
100 98
 	log.Debugf("pulling v1 repository with local name %q", repoInfo.LocalName)
101 99
 	if err = s.pullRepository(r, job.Stdout, repoInfo, tag, sf, job.GetenvBool("parallel")); err != nil {
102 100
 		return job.Error(err)