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:
parent
a372f982c1
commit
bcdf03037b
1 changed files with 6 additions and 1 deletions
|
@ -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) {
|
func (graph *Graph) getRemoteTags(stdout io.Writer, registries []string, repository string, token []string) (map[string]string, error) {
|
||||||
client := graph.getHttpClient()
|
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 {
|
for _, host := range registries {
|
||||||
endpoint := "https://" + host + "/v1/repositories/" + repository + "/tags"
|
endpoint := "https://" + host + "/v1/repositories/" + repository + "/tags"
|
||||||
req, err := http.NewRequest("GET", endpoint, nil)
|
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 {
|
func (graph *Graph) PullRepository(stdout io.Writer, remote, askedTag string, repositories *TagStore, authConfig *auth.AuthConfig) error {
|
||||||
client := graph.getHttpClient()
|
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"
|
repositoryTarget := INDEX_ENDPOINT + "/repositories/" + remote + "/images"
|
||||||
|
|
||||||
req, err := http.NewRequest("GET", repositoryTarget, nil)
|
req, err := http.NewRequest("GET", repositoryTarget, nil)
|
||||||
|
|
Loading…
Add table
Reference in a new issue