mirror of
https://github.com/containers/podman.git
synced 2025-10-17 19:24:04 +08:00
Inline getTags into its only user
This also eliminates a duplicate call to reference.Parse() and removes an impossible erorr path. Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com> Closes: #1112 Approved by: rhatdan
This commit is contained in:

committed by
Atomic Bot

parent
e8bc914134
commit
014b3dcc35
@ -28,10 +28,7 @@ func decompose(input string) (imageParts, error) {
|
||||
if err != nil {
|
||||
return parts, err
|
||||
}
|
||||
ntag, isTagged, err := getTags(input)
|
||||
if err != nil {
|
||||
return parts, err
|
||||
}
|
||||
ntag, isTagged := imgRef.(reference.NamedTagged)
|
||||
if !isTagged {
|
||||
tag = "latest"
|
||||
if strings.Contains(input, "@sha256:") {
|
||||
|
@ -12,16 +12,6 @@ import (
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
func getTags(nameInput string) (reference.NamedTagged, bool, error) {
|
||||
inputRef, err := reference.Parse(nameInput)
|
||||
if err != nil {
|
||||
return nil, false, errors.Wrapf(err, "unable to obtain tag from input name")
|
||||
}
|
||||
tagged, isTagged := inputRef.(reference.NamedTagged)
|
||||
|
||||
return tagged, isTagged, nil
|
||||
}
|
||||
|
||||
// findImageInRepotags takes an imageParts struct and searches images' repotags for
|
||||
// a match on name:tag
|
||||
func findImageInRepotags(search imageParts, images []*Image) (*storage.Image, error) {
|
||||
|
Reference in New Issue
Block a user