1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Fixed pulling repositories from library

This commit is contained in:
Sam Alba 2013-05-02 18:52:23 -07:00 committed by shin-
parent a372f982c1
commit bcdf03037b

View file

@ -168,6 +168,11 @@ func (graph *Graph) getRemoteImage(stdout io.Writer, imgId, registry string, tok
func (graph *Graph) getRemoteTags(stdout io.Writer, registries []string, repository string, token []string) (map[string]string, error) {
client := graph.getHttpClient()
if strings.Count(repository, "/") == 0 {
// This will be removed once the Registry supports auto-resolution on
// the "library" namespace
repository = "library/" + repository
}
for _, host := range registries {
endpoint := "https://" + host + "/v1/repositories/" + repository + "/tags"
req, err := http.NewRequest("GET", endpoint, nil)
@ -257,7 +262,7 @@ func (graph *Graph) PullImage(stdout io.Writer, imgId, registry string, token []
func (graph *Graph) PullRepository(stdout io.Writer, remote, askedTag string, repositories *TagStore, authConfig *auth.AuthConfig) error {
client := graph.getHttpClient()
fmt.Fprintf(stdout, "Pulling repository %s\r\n", remote)
fmt.Fprintf(stdout, "Pulling repository %s from %s\r\n", remote, INDEX_ENDPOINT)
repositoryTarget := INDEX_ENDPOINT + "/repositories/" + remote + "/images"
req, err := http.NewRequest("GET", repositoryTarget, nil)