From bcdf03037b5f11d3760b45c96b9180f7b8da4b40 Mon Sep 17 00:00:00 2001 From: Sam Alba Date: Thu, 2 May 2013 18:52:23 -0700 Subject: [PATCH] Fixed pulling repositories from library --- registry.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/registry.go b/registry.go index 0aab3f003e..592b13da6e 100644 --- a/registry.go +++ b/registry.go @@ -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)