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:
parent
3538174e60
commit
525802f9ce
@ -19,8 +19,8 @@ package archive
|
|||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/containerd/cri/pkg/util"
|
"github.com/docker/distribution/reference"
|
||||||
digest "github.com/opencontainers/go-digest"
|
"github.com/opencontainers/go-digest"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ func isImagePrefix(s, prefix string) bool {
|
|||||||
|
|
||||||
func normalizeReference(ref string) (string, error) {
|
func normalizeReference(ref string) (string, error) {
|
||||||
// TODO: Replace this function to not depend on reference package
|
// TODO: Replace this function to not depend on reference package
|
||||||
normalized, err := util.NormalizeImageRef(ref)
|
normalized, err := reference.ParseDockerRef(ref)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", errors.Wrapf(err, "normalize image ref %q", ref)
|
return "", errors.Wrapf(err, "normalize image ref %q", ref)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user