summaryrefslogtreecommitdiff
path: root/pkg/spec/containerconfig.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/spec/containerconfig.go')
-rw-r--r--pkg/spec/containerconfig.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/pkg/spec/containerconfig.go b/pkg/spec/containerconfig.go
new file mode 100644
index 000000000..62108c012
--- /dev/null
+++ b/pkg/spec/containerconfig.go
@@ -0,0 +1,22 @@
+package createconfig
+
+import (
+ "github.com/containers/libpod/libpod"
+ spec "github.com/opencontainers/runtime-spec/specs-go"
+)
+
+// MakeContainerConfig generates all configuration necessary to start a
+// container with libpod from a completed CreateConfig struct.
+func (config *CreateConfig) MakeContainerConfig(runtime *libpod.Runtime, pod *libpod.Pod) (*spec.Spec, []libpod.CtrCreateOption, error) {
+ runtimeSpec, err := config.createConfigToOCISpec()
+ if err != nil {
+ return nil, nil, err
+ }
+
+ options, err := config.getContainerCreateOptions(runtime, pod)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ return runtimeSpec, options, nil
+}