Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run by shortname #182

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions cmd/podman/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ func imageData(c *cli.Context, runtime *libpod.Runtime, image string) (string, s
if err != nil {
return "", "", nil, err
}
storageImage, err := runtime.GetImage(image)
storageImage, err := runtime.GetImage(imageName)
if err != nil {
return "", "", nil, errors.Wrapf(err, "error getting storage image %q", image)
}
Expand Down Expand Up @@ -452,7 +452,6 @@ func parseCreateOpts(c *cli.Context, runtime *libpod.Runtime) (*createConfig, er
}
shmDir = ctr.ShmDir()
}

imageName, imageID, data, err := imageData(c, runtime, image)
if err != nil {
return nil, err
Expand Down
9 changes: 4 additions & 5 deletions libpod/runtime_img.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,12 +328,12 @@ func getTags(nameInput string) (reference.NamedTagged, bool, error) {
// It will return an empty string and error if not found.
func (k *Image) GetLocalImageName() (string, error) {
_, err := k.runtime.GetImage(k.Name)
if err != nil {
return "", errors.Wrapf(err, "unable to obtain local image")
if err == nil {
return k.Name, nil
}
localImages, err := k.runtime.GetImages(&ImageFilterParams{})
if err != nil {
return "", errors.Wrapf(err, "unable to obtain local image")
return "", errors.Wrapf(err, "unable to find local images")
}
_, isTagged, err := getTags(k.Name)
if err != nil {
Expand Down Expand Up @@ -370,8 +370,7 @@ func (k *Image) GetLocalImageName() (string, error) {
}
}
}
fqname, _ := k.GetFQName()
return fqname, nil
return "", errors.Wrapf(storage.ErrImageUnknown, "unable to find image locally")
}

// HasLatest determines if we have the latest image local
Expand Down