summaryrefslogtreecommitdiff
path: root/pkg/varlinkapi/containers_create.go
blob: c1c1f66743f27f857ed00f3323ca553c9f8d7732 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// +build varlink

package varlinkapi

import (
	"github.com/containers/libpod/cmd/podman/shared"
	iopodman "github.com/containers/libpod/pkg/varlink"
)

// CreateContainer ...
func (i *VarlinkAPI) CreateContainer(call iopodman.VarlinkCall, config iopodman.Create) error {
	generic := shared.VarlinkCreateToGeneric(config)
	ctr, _, err := shared.CreateContainer(getContext(), &generic, i.Runtime)
	if err != nil {
		return call.ReplyErrorOccurred(err.Error())
	}
	return call.ReplyCreateContainer(ctr.ID())
}