docker/docker-py — pull request #409 by mattmoor (2014-11-26 05:17:06+00:00)
Title: Fix expand_registry_url to be consistent with docker client.

In docker-py's auth.py the functions 'resolve_repository_name' and 'expand_registry_url' work together to resolve a hostname prefix to a base URL suitable for interaction as a Docker registry.

For example, "docker push foo.com/bar/baz" would try to resolve the base URL "http[s]://foo.com".

These functions loosely correlate to 'ResolveRepositoryName' and 'newEndpoint' in the docker client code, respectively.

You can see from their implementations:
- ResolveRepositoryName: https://github.com/docker/docker/blob/master/registry/registry.go#L191
- newEndpoint: https://github.com/docker/docker/blob/master/registry/endpoint.go#L71

that neither of them appends 'v1' to the hostname during resolution.

This change simply removes the 'v1' suffix from these code paths, which enables docker-py to authenticate against private registries with which the docker client can already.