summaryrefslogtreecommitdiff
path: root/pkg/adapter
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-04-13 01:32:37 -0700
committerGitHub <noreply@github.com>2019-04-13 01:32:37 -0700
commit852ca40665d7a0b08ee749e08cb46625c9763f35 (patch)
tree6935833e4449d993c2bd0c99507b47392345a5ae /pkg/adapter
parent15723671b3edefd3cac150dc86323aa1f701ef8d (diff)
parent0a7b5b4e086ee4583b8550d80934dfa5c356ff64 (diff)
downloadpodman-852ca40665d7a0b08ee749e08cb46625c9763f35.tar.gz
podman-852ca40665d7a0b08ee749e08cb46625c9763f35.tar.bz2
podman-852ca40665d7a0b08ee749e08cb46625c9763f35.zip
Merge pull request #2910 from giuseppe/fix-create-2-containers
create: fix segfault if container name already exists
Diffstat (limited to 'pkg/adapter')
-rw-r--r--pkg/adapter/containers.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/pkg/adapter/containers.go b/pkg/adapter/containers.go
index d4e8e30d9..2be4793a7 100644
--- a/pkg/adapter/containers.go
+++ b/pkg/adapter/containers.go
@@ -257,7 +257,10 @@ func (r *LocalRuntime) Log(c *cliconfig.LogsValues, options *libpod.LogOptions)
func (r *LocalRuntime) CreateContainer(ctx context.Context, c *cliconfig.CreateValues) (string, error) {
results := shared.NewIntermediateLayer(&c.PodmanCommand, false)
ctr, _, err := shared.CreateContainer(ctx, &results, r.Runtime)
- return ctr.ID(), err
+ if err != nil {
+ return "", err
+ }
+ return ctr.ID(), nil
}
// Run a libpod container