From ae9b63fbf0c888a6f8f64f5ce1ec0faf35c70c74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Mon, 20 Nov 2023 19:04:16 +0100 Subject: [PATCH] Check for imageID, not imageName MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We are only using imageID on that branch, so it is more consistent. Should not change behavior; in callers, either both are set or neither. [NO NEW TESTS NEEDED] Signed-off-by: Miloslav Trmač --- libpod/storage.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libpod/storage.go b/libpod/storage.go index 33fd95357b..3f667c3199 100644 --- a/libpod/storage.go +++ b/libpod/storage.go @@ -66,11 +66,12 @@ func (metadata *RuntimeContainerMetadata) SetMountLabel(mountLabel string) { metadata.MountLabel = mountLabel } -// CreateContainerStorage creates the storage end of things. We already have the container spec created +// CreateContainerStorage creates the storage end of things. We already have the container spec created. +// imageID and imageName must both be either empty or non-empty. // TO-DO We should be passing in an Image object in the future. 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 != "" { + if imageID != "" { if containerName == "" { return ContainerInfo{}, define.ErrEmptyID }