From 1901fdfd48e9623124727addae30305d891251d4 Mon Sep 17 00:00:00 2001 From: ktock Date: Thu, 6 May 2021 11:19:37 +0900 Subject: [PATCH] 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 --- common/libimage/pull.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/libimage/pull.go b/common/libimage/pull.go index b67274b5d8..cb641e483a 100644 --- a/common/libimage/pull.go +++ b/common/libimage/pull.go @@ -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) }