Merge pull request #17203 from hopkings2008/auth_token

In NewV2Repository, check the suffix of endpoint.URL and append 'v2' …
This commit is contained in:
Jess Frazelle 2015-10-21 14:57:05 -07:00
Родитель ab22fe0f7c 5f59f52c14
Коммит 697d4c9e72
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -17,6 +17,7 @@ import (
"github.com/docker/docker/cliconfig" "github.com/docker/docker/cliconfig"
"github.com/docker/docker/registry" "github.com/docker/docker/registry"
"golang.org/x/net/context" "golang.org/x/net/context"
"strings"
) )
type dumbCredentialStore struct { type dumbCredentialStore struct {
@ -59,7 +60,7 @@ func NewV2Repository(repoInfo *registry.RepositoryInfo, endpoint registry.APIEnd
Transport: authTransport, Transport: authTransport,
Timeout: 15 * time.Second, Timeout: 15 * time.Second,
} }
endpointStr := endpoint.URL + "/v2/" endpointStr := strings.TrimRight(endpoint.URL, "/") + "/v2/"
req, err := http.NewRequest("GET", endpointStr, nil) req, err := http.NewRequest("GET", endpointStr, nil)
if err != nil { if err != nil {
return nil, err return nil, err