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 <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2019-02-07 13:13:25 +01:00
parent 3538174e60
commit 525802f9ce
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C

View File

@ -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)
}