From ff80e40adfa7e103bb13fd9e4a5703396cffed43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Mon, 20 Nov 2023 18:26:38 +0100 Subject: [PATCH] Use NewStoreReference instead of ParseStoreReference MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit By construction, imageID is a full image ID, so avoid heuristics by using a more specific API. Signed-off-by: Miloslav Trmač --- libpod/storage.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libpod/storage.go b/libpod/storage.go index e602182514..33fd95357b 100644 --- a/libpod/storage.go +++ b/libpod/storage.go @@ -71,12 +71,11 @@ func (metadata *RuntimeContainerMetadata) SetMountLabel(mountLabel string) { func (r *storageService) CreateContainerStorage(ctx context.Context, systemContext *types.SystemContext, imageName, imageID, containerName, containerID string, options storage.ContainerOptions) (_ ContainerInfo, retErr error) { var imageConfig *v1.Image if imageName != "" { - var ref types.ImageReference if containerName == "" { return ContainerInfo{}, define.ErrEmptyID } // Check if we have the specified image. - ref, err := istorage.Transport.ParseStoreReference(r.store, imageID) + ref, err := istorage.Transport.NewStoreReference(r.store, nil, imageID) if err != nil { return ContainerInfo{}, err }