mirror of https://github.com/containers/podman.git
Use the result of reference.Parse when checking for digests.
No need to do a separate string search when reference.Parse has already determined this. Changes behavior: non-SHA256 digest formats are now recognized as well. Signed-off-by: Miloslav Trmač <mitr@redhat.com> Closes: #1112 Approved by: rhatdan
This commit is contained in:
parent
38842bd407
commit
8ff0eb53cb
|
@ -2,7 +2,6 @@ package image
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/containers/image/docker/reference"
|
||||
)
|
||||
|
@ -31,7 +30,7 @@ func decompose(input string) (imageParts, error) {
|
|||
ntag, isTagged := imgRef.(reference.NamedTagged)
|
||||
if !isTagged {
|
||||
tag = "latest"
|
||||
if strings.Contains(input, "@sha256:") {
|
||||
if _, hasDigest := imgRef.(reference.Digested); hasDigest {
|
||||
tag = "none"
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue