summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-12-21 16:00:22 +0100
committerGitHub <noreply@github.com>2021-12-21 16:00:22 +0100
commit253fddbdfdac0595ef1ce5ccf6bdd5fa94e5e32c (patch)
treed3c43818c08d984d373e2d2234486dfaa6beccbb /pkg
parentf3d6672c7d95e09b312ac8db43e54618d4dd1662 (diff)
parentb1f5e861b0fa9220fbf2e95a2580892f98a803ca (diff)
downloadpodman-253fddbdfdac0595ef1ce5ccf6bdd5fa94e5e32c.tar.gz
podman-253fddbdfdac0595ef1ce5ccf6bdd5fa94e5e32c.tar.bz2
podman-253fddbdfdac0595ef1ce5ccf6bdd5fa94e5e32c.zip
Merge pull request #12663 from vrothberg/compat-normalization
compat: image normalization: handle sha256 prefix
Diffstat (limited to 'pkg')
-rw-r--r--pkg/api/handlers/utils/images.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/api/handlers/utils/images.go b/pkg/api/handlers/utils/images.go
index d874165e3..3f3f48193 100644
--- a/pkg/api/handlers/utils/images.go
+++ b/pkg/api/handlers/utils/images.go
@@ -35,7 +35,7 @@ func NormalizeToDockerHub(r *http.Request, nameOrID string) (string, error) {
if errors.Cause(err) != storage.ErrImageUnknown {
return "", fmt.Errorf("normalizing name for compat API: %v", err)
}
- } else if strings.HasPrefix(img.ID(), nameOrID) {
+ } else if strings.HasPrefix(img.ID(), strings.TrimPrefix(nameOrID, "sha256:")) {
return img.ID(), nil
}