Implement the "library" repository endpoint on the registry

Upstream-commit: 5c04d3488a0c02426ea08dcd9b1ead5884062836
Component: engine
This commit is contained in:
Guillaume J. Charmes
2013-03-22 17:41:48 -07:00
parent d64409ad42
commit f375f50cbd

View File

@ -164,7 +164,15 @@ func (graph *Graph) PullRepository(stdout io.Writer, remote, askedTag string, re
fmt.Fprintf(stdout, "Pulling repo: %s\n", REGISTRY_ENDPOINT+"/users/"+remote)
req, err := http.NewRequest("GET", REGISTRY_ENDPOINT+"/users/"+remote, nil)
var repositoryTarget string
// If we are asking for 'root' repository, lookup on the Library's registry
if strings.Index(remote, "/") == -1 {
repositoryTarget = REGISTRY_ENDPOINT + "/library/" + remote
} else {
repositoryTarget = REGISTRY_ENDPOINT + "/users/" + remote
}
req, err := http.NewRequest("GET", repositoryTarget, nil)
if err != nil {
return err
}