summaryrefslogtreecommitdiff
path: root/cmd/podman/shared
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-03-28 07:06:31 -0700
committerGitHub <noreply@github.com>2019-03-28 07:06:31 -0700
commite7a2eecf5f3975edfb92cd2cacff0d34ef45f808 (patch)
tree5557aaeb6ec27d61b75b1db18dc5e0a4d85c90be /cmd/podman/shared
parent850326cc192444d1c5cfd8ba6e1015f653b41e73 (diff)
parent179a66f1a0a22be66c0346afa8ea3181d5846fb2 (diff)
downloadpodman-e7a2eecf5f3975edfb92cd2cacff0d34ef45f808.tar.gz
podman-e7a2eecf5f3975edfb92cd2cacff0d34ef45f808.tar.bz2
podman-e7a2eecf5f3975edfb92cd2cacff0d34ef45f808.zip
Merge pull request #2760 from mheon/misc_small_changes
Remove ulele/deepcopier in favor of JSON deep copy
Diffstat (limited to 'cmd/podman/shared')
-rw-r--r--cmd/podman/shared/create.go15
1 files changed, 11 insertions, 4 deletions
diff --git a/cmd/podman/shared/create.go b/cmd/podman/shared/create.go
index 5f7263cb6..d927e5bf6 100644
--- a/cmd/podman/shared/create.go
+++ b/cmd/podman/shared/create.go
@@ -43,20 +43,23 @@ func getContext() context.Context {
func CreateContainer(ctx context.Context, c *cliconfig.PodmanCommand, runtime *libpod.Runtime) (*libpod.Container, *cc.CreateConfig, error) {
var (
healthCheck *manifest.Schema2HealthConfig
+ err error
+ cidFile *os.File
)
if c.Bool("trace") {
span, _ := opentracing.StartSpanFromContext(ctx, "createContainer")
defer span.Finish()
}
- rtc := runtime.GetConfig()
+ rtc, err := runtime.GetConfig()
+ if err != nil {
+ return nil, nil, err
+ }
rootfs := ""
if c.Bool("rootfs") {
rootfs = c.InputArgs[0]
}
- var err error
- var cidFile *os.File
if c.IsSet("cidfile") && os.Geteuid() == 0 {
cidFile, err = libpod.OpenExclusiveFile(c.String("cidfile"))
if err != nil && os.IsExist(err) {
@@ -721,7 +724,11 @@ func ParseCreateOpts(ctx context.Context, c *cliconfig.PodmanCommand, runtime *l
if c.Bool("init") {
initPath := c.String("init-path")
if initPath == "" {
- initPath = runtime.GetConfig().InitPath
+ rtc, err := runtime.GetConfig()
+ if err != nil {
+ return nil, err
+ }
+ initPath = rtc.InitPath
}
if err := config.AddContainerInitBinary(initPath); err != nil {
return nil, err