aboutsummaryrefslogtreecommitdiff
path: root/pkg/api/handlers/compat/containers_create.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-06-24 05:40:08 -0400
committerGitHub <noreply@github.com>2021-06-24 05:40:08 -0400
commit3ee967bd5da30ddbd3a8625b00bb82f903641800 (patch)
tree5a85a915899aa3dee6d5d34ab6ec9538a312a8a0 /pkg/api/handlers/compat/containers_create.go
parent7d8f111245b8f6500890f21116c43d65985c31cc (diff)
parent6f769bc0e9879e981fc4b8bc0d474b7ad4049431 (diff)
downloadpodman-3ee967bd5da30ddbd3a8625b00bb82f903641800.tar.gz
podman-3ee967bd5da30ddbd3a8625b00bb82f903641800.tar.bz2
podman-3ee967bd5da30ddbd3a8625b00bb82f903641800.zip
Merge pull request #10763 from vrothberg/3.2-backports
3.2 backports
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 162a98135..15eb86422 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)