summaryrefslogtreecommitdiff
path: root/pkg/domain/infra/abi/containers.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-04-03 23:53:45 +0200
committerGitHub <noreply@github.com>2020-04-03 23:53:45 +0200
commitf7dffedeb610df662e69915fcff1bb37986baf55 (patch)
tree33ced51adee58d38b39416191e2e8a207ce4ec47 /pkg/domain/infra/abi/containers.go
parent35f586783388cdff6b4f15e7aff4df1ee72d9b67 (diff)
parent6514a5c80ef91ef6e16e283339cd0b5f78a42322 (diff)
downloadpodman-f7dffedeb610df662e69915fcff1bb37986baf55.tar.gz
podman-f7dffedeb610df662e69915fcff1bb37986baf55.tar.bz2
podman-f7dffedeb610df662e69915fcff1bb37986baf55.zip
Merge pull request #5710 from baude/v2create
v2podman container create
Diffstat (limited to 'pkg/domain/infra/abi/containers.go')
-rw-r--r--pkg/domain/infra/abi/containers.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/pkg/domain/infra/abi/containers.go b/pkg/domain/infra/abi/containers.go
index 3c38b2093..d3d51db82 100644
--- a/pkg/domain/infra/abi/containers.go
+++ b/pkg/domain/infra/abi/containers.go
@@ -16,6 +16,8 @@ import (
"github.com/containers/libpod/pkg/checkpoint"
"github.com/containers/libpod/pkg/domain/entities"
"github.com/containers/libpod/pkg/signal"
+ "github.com/containers/libpod/pkg/specgen"
+ "github.com/containers/libpod/pkg/specgen/generate"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
)
@@ -442,3 +444,14 @@ func (ic *ContainerEngine) ContainerRestore(ctx context.Context, namesOrIds []st
}
return reports, nil
}
+
+func (ic *ContainerEngine) ContainerCreate(ctx context.Context, s *specgen.SpecGenerator) (*entities.ContainerCreateReport, error) {
+ if err := generate.CompleteSpec(ctx, ic.Libpod, s); err != nil {
+ return nil, err
+ }
+ ctr, err := generate.MakeContainer(ic.Libpod, s)
+ if err != nil {
+ return nil, err
+ }
+ return &entities.ContainerCreateReport{Id: ctr.ID()}, nil
+}