diff --git a/docs/config.go b/docs/config.go index 2eeba140..45caf578 100644 --- a/docs/config.go +++ b/docs/config.go @@ -7,11 +7,12 @@ import ( "net/url" "strings" - "github.com/docker/distribution/reference" + distreference "github.com/docker/distribution/reference" registrytypes "github.com/docker/docker/api/types/registry" "github.com/docker/docker/image/v1" "github.com/docker/docker/opts" flag "github.com/docker/docker/pkg/mflag" + "github.com/docker/docker/reference" ) // Options holds command line options. @@ -269,7 +270,7 @@ func GetAuthConfigKey(index *registrytypes.IndexInfo) string { // splitReposName breaks a reposName into an index name and remote name func splitReposName(reposName reference.Named) (indexName string, remoteName reference.Named, err error) { var remoteNameStr string - indexName, remoteNameStr = reference.SplitHostname(reposName) + indexName, remoteNameStr = distreference.SplitHostname(reposName) if indexName == "" || (!strings.Contains(indexName, ".") && !strings.Contains(indexName, ":") && indexName != "localhost") { // This is a Docker Index repos (ex: samalba/hipache or ubuntu) @@ -405,13 +406,13 @@ func localNameFromRemote(indexName string, remoteName reference.Named) (referenc // error. func NormalizeLocalReference(ref reference.Named) reference.Named { localName := NormalizeLocalName(ref) - if tagged, isTagged := ref.(reference.Tagged); isTagged { + if tagged, isTagged := ref.(reference.NamedTagged); isTagged { newRef, err := reference.WithTag(localName, tagged.Tag()) if err != nil { return ref } return newRef - } else if digested, isDigested := ref.(reference.Digested); isDigested { + } else if digested, isCanonical := ref.(reference.Canonical); isCanonical { newRef, err := reference.WithDigest(localName, digested.Digest()) if err != nil { return ref diff --git a/docs/registry_mock_test.go b/docs/registry_mock_test.go index f45de5c8..017d08bb 100644 --- a/docs/registry_mock_test.go +++ b/docs/registry_mock_test.go @@ -15,9 +15,9 @@ import ( "testing" "time" - "github.com/docker/distribution/reference" registrytypes "github.com/docker/docker/api/types/registry" "github.com/docker/docker/opts" + "github.com/docker/docker/reference" "github.com/gorilla/mux" "github.com/Sirupsen/logrus" diff --git a/docs/registry_test.go b/docs/registry_test.go index 7e352441..31ae2d5f 100644 --- a/docs/registry_test.go +++ b/docs/registry_test.go @@ -8,10 +8,10 @@ import ( "strings" "testing" - "github.com/docker/distribution/reference" "github.com/docker/distribution/registry/client/transport" "github.com/docker/docker/api/types" registrytypes "github.com/docker/docker/api/types/registry" + "github.com/docker/docker/reference" ) var ( diff --git a/docs/service.go b/docs/service.go index b826f117..eb5cd6bf 100644 --- a/docs/service.go +++ b/docs/service.go @@ -6,10 +6,10 @@ import ( "net/url" "strings" - "github.com/docker/distribution/reference" "github.com/docker/distribution/registry/client/auth" "github.com/docker/docker/api/types" registrytypes "github.com/docker/docker/api/types/registry" + "github.com/docker/docker/reference" ) // Service is a registry service. It tracks configuration data such as a list diff --git a/docs/service_v1.go b/docs/service_v1.go index 5fdc1ece..3b3cc780 100644 --- a/docs/service_v1.go +++ b/docs/service_v1.go @@ -4,8 +4,8 @@ import ( "fmt" "strings" - "github.com/docker/distribution/reference" "github.com/docker/docker/pkg/tlsconfig" + "github.com/docker/docker/reference" ) func (s *Service) lookupV1Endpoints(repoName reference.Named) (endpoints []APIEndpoint, err error) { diff --git a/docs/service_v2.go b/docs/service_v2.go index 56a3d2ee..3a2c32a5 100644 --- a/docs/service_v2.go +++ b/docs/service_v2.go @@ -4,9 +4,9 @@ import ( "fmt" "strings" - "github.com/docker/distribution/reference" "github.com/docker/distribution/registry/client/auth" "github.com/docker/docker/pkg/tlsconfig" + "github.com/docker/docker/reference" ) func (s *Service) lookupV2Endpoints(repoName reference.Named) (endpoints []APIEndpoint, err error) { diff --git a/docs/session.go b/docs/session.go index d09babd4..a1206206 100644 --- a/docs/session.go +++ b/docs/session.go @@ -19,13 +19,13 @@ import ( "strings" "github.com/Sirupsen/logrus" - "github.com/docker/distribution/reference" "github.com/docker/docker/api/types" registrytypes "github.com/docker/docker/api/types/registry" "github.com/docker/docker/pkg/httputils" "github.com/docker/docker/pkg/ioutils" "github.com/docker/docker/pkg/stringid" "github.com/docker/docker/pkg/tarsum" + "github.com/docker/docker/reference" ) var ( diff --git a/docs/types.go b/docs/types.go index 03657820..939f44b1 100644 --- a/docs/types.go +++ b/docs/types.go @@ -1,8 +1,8 @@ package registry import ( - "github.com/docker/distribution/reference" registrytypes "github.com/docker/docker/api/types/registry" + "github.com/docker/docker/reference" ) // RepositoryData tracks the image list, list of endpoints, and list of tokens