Fix images tagged by 64 chars cannot be pulled when ommiting "docker://" prefix
Recently images tagged by 64 chars cannot be pulled when ommiting "docker://" prefix. This commit fixes this issue. Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
This commit is contained in:
parent
4769b30832
commit
1901fdfd48
|
|
@ -58,7 +58,7 @@ func (r *Runtime) Pull(ctx context.Context, name string, pullPolicy config.PullP
|
|||
if err != nil {
|
||||
// If the image clearly refers to a local one, we can look it up directly.
|
||||
// In fact, we need to since they are not parseable.
|
||||
if strings.HasPrefix(name, "sha256:") || (len(name) == 64 && !strings.Contains(name, "/.:@")) {
|
||||
if strings.HasPrefix(name, "sha256:") || (len(name) == 64 && !strings.ContainsAny(name, "/.:@")) {
|
||||
if pullPolicy == config.PullPolicyAlways {
|
||||
return nil, errors.Errorf("pull policy is always but image has been referred to by ID (%s)", name)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue