summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2018-07-19 01:15:02 +0200
committerAtomic Bot <atomic-devel@projectatomic.io>2018-07-23 12:44:38 +0000
commit8ff0eb53cb7bc1e38ce784ce71e44d03e0210af3 (patch)
tree39746c7c467f85a3ace5df8d70e946daae98d766 /libpod
parent38842bd4075f35073ba64ee52c329a408d54b088 (diff)
downloadpodman-8ff0eb53cb7bc1e38ce784ce71e44d03e0210af3.tar.gz
podman-8ff0eb53cb7bc1e38ce784ce71e44d03e0210af3.tar.bz2
podman-8ff0eb53cb7bc1e38ce784ce71e44d03e0210af3.zip
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
Diffstat (limited to 'libpod')
-rw-r--r--libpod/image/parts.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/libpod/image/parts.go b/libpod/image/parts.go
index bfc708ad7..127f723a8 100644
--- a/libpod/image/parts.go
+++ b/libpod/image/parts.go
@@ -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 {