Check for imageID, not imageName

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č <mitr@redhat.com>
This commit is contained in:
Miloslav Trmač
2023-11-20 19:04:16 +01:00
parent ff80e40adf
commit ae9b63fbf0

View File

@ -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
}