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

package varlinkapi

import (
	iopodman "github.com/containers/libpod/v2/pkg/varlink"
)

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