mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Fix the lookup method
This commit is contained in:
parent
0c4b639083
commit
5e6355d182
1 changed files with 2 additions and 2 deletions
|
@ -80,14 +80,14 @@ func (graph *Graph) getRemoteHistory(imgId string, authConfig *auth.AuthConfig)
|
|||
|
||||
// Check if an image exists in the Registry
|
||||
func (graph *Graph) LookupRemoteImage(imgId string, authConfig *auth.AuthConfig) bool {
|
||||
client := &http.Client{}
|
||||
rt := &http.Transport{Proxy: http.ProxyFromEnvironment}
|
||||
|
||||
req, err := http.NewRequest("GET", REGISTRY_ENDPOINT+"/images/"+imgId+"/json", nil)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
req.SetBasicAuth(authConfig.Username, authConfig.Password)
|
||||
res, err := client.Do(req)
|
||||
res, err := rt.RoundTrip(req)
|
||||
if err != nil || res.StatusCode != 307 {
|
||||
return false
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue