|
@@ -2,10 +2,10 @@ package image
|
|
|
|
|
|
import (
|
|
import (
|
|
"encoding/json"
|
|
"encoding/json"
|
|
- "fmt"
|
|
|
|
"regexp"
|
|
"regexp"
|
|
"time"
|
|
"time"
|
|
|
|
|
|
|
|
+ derr "github.com/docker/docker/errors"
|
|
"github.com/docker/docker/runconfig"
|
|
"github.com/docker/docker/runconfig"
|
|
)
|
|
)
|
|
|
|
|
|
@@ -53,7 +53,7 @@ func NewImgJSON(src []byte) (*Image, error) {
|
|
// ValidateID checks whether an ID string is a valid image ID.
|
|
// ValidateID checks whether an ID string is a valid image ID.
|
|
func ValidateID(id string) error {
|
|
func ValidateID(id string) error {
|
|
if ok := validHex.MatchString(id); !ok {
|
|
if ok := validHex.MatchString(id); !ok {
|
|
- return fmt.Errorf("image ID '%s' is invalid", id)
|
|
|
|
|
|
+ return derr.ErrorCodeInvalidImageID.WithArgs(id)
|
|
}
|
|
}
|
|
return nil
|
|
return nil
|
|
}
|
|
}
|