Skip to content

Commit

Permalink
Use NewStoreReference instead of ParseStoreReference
Browse files Browse the repository at this point in the history
By construction, imageID is a full image ID, so avoid heuristics
by using a more specific API.

Signed-off-by: Miloslav Trmač <[email protected]>
  • Loading branch information
mtrmac committed Nov 20, 2023
1 parent e9587f5 commit ff80e40
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions libpod/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit ff80e40

Please sign in to comment.