diff options
author | Brent Baude <bbaude@redhat.com> | 2020-03-24 07:28:36 -0500 |
---|---|---|
committer | Brent Baude <bbaude@redhat.com> | 2020-03-27 09:04:10 -0500 |
commit | e56d5295614b745115abf0198f7b67ae157aae1e (patch) | |
tree | 4b18581f6656f2bd6455e797f69ab7d45535ec6a /pkg/domain/infra/tunnel | |
parent | 7007680bfdee8c36b855a97ee45d268b24bde7d3 (diff) | |
download | podman-e56d5295614b745115abf0198f7b67ae157aae1e.tar.gz podman-e56d5295614b745115abf0198f7b67ae157aae1e.tar.bz2 podman-e56d5295614b745115abf0198f7b67ae157aae1e.zip |
podmanv2 pod create using podspecgen
using the factory approach similar to container, we now create pods based on a pod spec generator. wired up the podmanv2 pod create command, podcreatewithspec binding, simple binding test, and apiv2 endpoint.
also included some code refactoring as it introduced as easy circular import.
Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/domain/infra/tunnel')
-rw-r--r-- | pkg/domain/infra/tunnel/pods.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/pkg/domain/infra/tunnel/pods.go b/pkg/domain/infra/tunnel/pods.go index 53003da42..4894874e5 100644 --- a/pkg/domain/infra/tunnel/pods.go +++ b/pkg/domain/infra/tunnel/pods.go @@ -5,6 +5,7 @@ import ( "github.com/containers/libpod/pkg/bindings/pods" "github.com/containers/libpod/pkg/domain/entities" + "github.com/containers/libpod/pkg/specgen" ) func (ic *ContainerEngine) PodExists(ctx context.Context, nameOrId string) (*entities.BoolReport, error) { @@ -170,3 +171,9 @@ func (ic *ContainerEngine) PodRm(ctx context.Context, namesOrIds []string, optio } return reports, nil } + +func (ic *ContainerEngine) PodCreate(ctx context.Context, opts entities.PodCreateOptions) (*entities.PodCreateReport, error) { + podSpec := specgen.NewPodSpecGenerator() + opts.ToPodSpecGen(podSpec) + return pods.CreatePodFromSpec(ic.ClientCxt, podSpec) +} |