summaryrefslogtreecommitdiff
path: root/pkg/api/handlers/compat/containers_create.go
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2021-05-27 16:13:54 +0200
committerValentin Rothberg <rothberg@redhat.com>2021-05-31 14:38:43 +0200
commitfb4a0c572ed1264ebb12218e8905c4845cb159c5 (patch)
treeec71658e6352e62b29e8bb931faf96a0b644ed1c /pkg/api/handlers/compat/containers_create.go
parent59236762eca31a20d886837698db58e259a21de5 (diff)
downloadpodman-fb4a0c572ed1264ebb12218e8905c4845cb159c5.tar.gz
podman-fb4a0c572ed1264ebb12218e8905c4845cb159c5.tar.bz2
podman-fb4a0c572ed1264ebb12218e8905c4845cb159c5.zip
support tag@digest notation
Vendor in the latest HEAd of containers/common to implicitly support the tag@digest notation for images. To remain compatible with Docker, the tag will be stripped off the image reference and is entirely ignored. Fixes: #6721 Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'pkg/api/handlers/compat/containers_create.go')
-rw-r--r--pkg/api/handlers/compat/containers_create.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/pkg/api/handlers/compat/containers_create.go b/pkg/api/handlers/compat/containers_create.go
index 8e9e1fb39..0b5cbd343 100644
--- a/pkg/api/handlers/compat/containers_create.go
+++ b/pkg/api/handlers/compat/containers_create.go
@@ -71,13 +71,12 @@ func CreateContainer(w http.ResponseWriter, r *http.Request) {
imgNameOrID := newImage.ID()
// if the img had multi names with the same sha256 ID, should use the InputName, not the ID
if len(newImage.Names()) > 1 {
- imageRef, err := utils.ParseDockerReference(resolvedName)
- if err != nil {
+ if err := utils.IsRegistryReference(resolvedName); err != nil {
utils.Error(w, http.StatusText(http.StatusBadRequest), http.StatusBadRequest, err)
return
}
// maybe the InputName has no tag, so use full name to display
- imgNameOrID = imageRef.DockerReference().String()
+ imgNameOrID = resolvedName
}
sg := specgen.NewSpecGenerator(imgNameOrID, cliOpts.RootFS)