mirror of
https://github.com/containers/podman.git
synced 2025-05-21 00:56:36 +08:00
Use NewStoreReference instead of ParseStoreReference
By construction, imageID is a full image ID, so avoid heuristics by using a more specific API. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
@ -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) {
|
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
|
var imageConfig *v1.Image
|
||||||
if imageName != "" {
|
if imageName != "" {
|
||||||
var ref types.ImageReference
|
|
||||||
if containerName == "" {
|
if containerName == "" {
|
||||||
return ContainerInfo{}, define.ErrEmptyID
|
return ContainerInfo{}, define.ErrEmptyID
|
||||||
}
|
}
|
||||||
// Check if we have the specified image.
|
// 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 {
|
if err != nil {
|
||||||
return ContainerInfo{}, err
|
return ContainerInfo{}, err
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user