mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #1109 from dynport/remote-lookup-fix
Fix remote lookup when pushing into registry
This commit is contained in:
commit
5dcd11be16
2 changed files with 2 additions and 2 deletions
|
@ -67,7 +67,7 @@ func (r *Registry) GetRemoteHistory(imgId, registry string, token []string) ([]s
|
||||||
func (r *Registry) LookupRemoteImage(imgId, registry string, token []string) bool {
|
func (r *Registry) LookupRemoteImage(imgId, registry string, token []string) bool {
|
||||||
rt := &http.Transport{Proxy: http.ProxyFromEnvironment}
|
rt := &http.Transport{Proxy: http.ProxyFromEnvironment}
|
||||||
|
|
||||||
req, err := http.NewRequest("GET", registry+"/images/"+imgId+"/json", nil)
|
req, err := http.NewRequest("GET", registry+"/v1/images/"+imgId+"/json", nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
|
@ -626,7 +626,7 @@ func (srv *Server) pushRepository(r *registry.Registry, out io.Writer, name, reg
|
||||||
if _, exists := repoData.ImgList[elem.ID]; exists {
|
if _, exists := repoData.ImgList[elem.ID]; exists {
|
||||||
out.Write(sf.FormatStatus("Image %s already on registry, skipping", name))
|
out.Write(sf.FormatStatus("Image %s already on registry, skipping", name))
|
||||||
continue
|
continue
|
||||||
} else if registryEp != "" && r.LookupRemoteImage(elem.ID, registryEp, repoData.Tokens) {
|
} else if r.LookupRemoteImage(elem.ID, ep, repoData.Tokens) {
|
||||||
fmt.Fprintf(out, "Image %s already on registry, skipping\n", name)
|
fmt.Fprintf(out, "Image %s already on registry, skipping\n", name)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue