Replace util.NormalizeImageRef with reference.ParseDockerRef

Using the utility caused other project to have containerd/cri
as a dependency, only for this utility. The new `reference.ParseDockerRef`
function does the same (it's a copy of this function).

Tests were kept for now, but could be removed in future.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2019-02-07 13:22:58 +01:00
parent 0ad60d4d9e
commit 51affb8839
5 changed files with 10 additions and 29 deletions

View File

@@ -50,7 +50,6 @@ import (
containerstore "github.com/containerd/cri/pkg/store/container"
imagestore "github.com/containerd/cri/pkg/store/image"
sandboxstore "github.com/containerd/cri/pkg/store/sandbox"
"github.com/containerd/cri/pkg/util"
)
const (
@@ -264,7 +263,7 @@ func (c *criService) localResolve(refOrID string) (imagestore.Image, error) {
return func(ref string) string {
// ref is not image id, try to resolve it locally.
// TODO(random-liu): Handle this error better for debugging.
normalized, err := util.NormalizeImageRef(ref)
normalized, err := reference.ParseDockerRef(ref)
if err != nil {
return ""
}