|
@@ -7,7 +7,7 @@ import (
|
|
|
|
|
|
"github.com/docker/distribution/digest"
|
|
"github.com/docker/distribution/digest"
|
|
distreference "github.com/docker/distribution/reference"
|
|
distreference "github.com/docker/distribution/reference"
|
|
- "github.com/docker/docker/image/v1"
|
|
|
|
|
|
+ "github.com/docker/docker/pkg/stringid"
|
|
)
|
|
)
|
|
|
|
|
|
const (
|
|
const (
|
|
@@ -163,7 +163,7 @@ func IsNameOnly(ref Named) bool {
|
|
// ParseIDOrReference parses string for an image ID or a reference. ID can be
|
|
// ParseIDOrReference parses string for an image ID or a reference. ID can be
|
|
// without a default prefix.
|
|
// without a default prefix.
|
|
func ParseIDOrReference(idOrRef string) (digest.Digest, Named, error) {
|
|
func ParseIDOrReference(idOrRef string) (digest.Digest, Named, error) {
|
|
- if err := v1.ValidateID(idOrRef); err == nil {
|
|
|
|
|
|
+ if err := stringid.ValidateID(idOrRef); err == nil {
|
|
idOrRef = "sha256:" + idOrRef
|
|
idOrRef = "sha256:" + idOrRef
|
|
}
|
|
}
|
|
if dgst, err := digest.ParseDigest(idOrRef); err == nil {
|
|
if dgst, err := digest.ParseDigest(idOrRef); err == nil {
|
|
@@ -209,7 +209,7 @@ func normalize(name string) (string, error) {
|
|
}
|
|
}
|
|
|
|
|
|
func validateName(name string) error {
|
|
func validateName(name string) error {
|
|
- if err := v1.ValidateID(name); err == nil {
|
|
|
|
|
|
+ if err := stringid.ValidateID(name); err == nil {
|
|
return fmt.Errorf("Invalid repository name (%s), cannot specify 64-byte hexadecimal strings", name)
|
|
return fmt.Errorf("Invalid repository name (%s), cannot specify 64-byte hexadecimal strings", name)
|
|
}
|
|
}
|
|
return nil
|
|
return nil
|