From 525802f9ce4efd3e77f136f25337004c2141105d Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 7 Feb 2019 13:13:25 +0100 Subject: [PATCH] Use distribution's reference.ParseDockerRef Using the cri utility caused other project to have containerd/cri as a dependency, only for this utility. The new `reference.ParseDockerRef` function does the same (other than having a different name). Signed-off-by: Sebastiaan van Stijn --- images/archive/reference.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/images/archive/reference.go b/images/archive/reference.go index 0b1310181..2e80a968a 100644 --- a/images/archive/reference.go +++ b/images/archive/reference.go @@ -19,8 +19,8 @@ package archive import ( "strings" - "github.com/containerd/cri/pkg/util" - digest "github.com/opencontainers/go-digest" + "github.com/docker/distribution/reference" + "github.com/opencontainers/go-digest" "github.com/pkg/errors" ) @@ -69,7 +69,7 @@ func isImagePrefix(s, prefix string) bool { func normalizeReference(ref string) (string, error) { // TODO: Replace this function to not depend on reference package - normalized, err := util.NormalizeImageRef(ref) + normalized, err := reference.ParseDockerRef(ref) if err != nil { return "", errors.Wrapf(err, "normalize image ref %q", ref) }