summaryrefslogtreecommitdiff
path: root/pkg/spec/createconfig.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2019-03-25 15:43:38 -0400
committerMatthew Heon <matthew.heon@pm.me>2019-03-27 20:00:31 -0400
commit5ed62991dcbe85e28774b036a7c89033af80136f (patch)
treeea5b57abb6290bf0afac083292aad6dc653f52be /pkg/spec/createconfig.go
parent340eeec1b654880f9d339c9ac2957bcaeaee6829 (diff)
downloadpodman-5ed62991dcbe85e28774b036a7c89033af80136f.tar.gz
podman-5ed62991dcbe85e28774b036a7c89033af80136f.tar.bz2
podman-5ed62991dcbe85e28774b036a7c89033af80136f.zip
Remove ulele/deepcopier in favor of JSON deep copy
We have a very high performance JSON library that doesn't need to perform code generation. Let's use it instead of our questionably performant, reflection-dependent deep copy library. Most changes because some functions can now return errors. Also converts cmd/podman to use jsoniter, instead of pkg/json, for increased performance. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'pkg/spec/createconfig.go')
-rw-r--r--pkg/spec/createconfig.go15
1 files changed, 11 insertions, 4 deletions
diff --git a/pkg/spec/createconfig.go b/pkg/spec/createconfig.go
index 79a318771..07ae633d1 100644
--- a/pkg/spec/createconfig.go
+++ b/pkg/spec/createconfig.go
@@ -346,8 +346,11 @@ func (c *CreateConfig) GetTmpfsMounts() []spec.Mount {
return m
}
-func (c *CreateConfig) createExitCommand() []string {
- config := c.Runtime.GetConfig()
+func (c *CreateConfig) createExitCommand() ([]string, error) {
+ config, err := c.Runtime.GetConfig()
+ if err != nil {
+ return nil, err
+ }
cmd, _ := os.Executable()
command := []string{cmd,
@@ -372,7 +375,7 @@ func (c *CreateConfig) createExitCommand() []string {
command = append(command, "--rm")
}
- return command
+ return command, nil
}
// GetContainerCreateOptions takes a CreateConfig and returns a slice of CtrCreateOptions
@@ -567,7 +570,11 @@ func (c *CreateConfig) GetContainerCreateOptions(runtime *libpod.Runtime, pod *l
}
// Always use a cleanup process to clean up Podman after termination
- options = append(options, libpod.WithExitCommand(c.createExitCommand()))
+ exitCmd, err := c.createExitCommand()
+ if err != nil {
+ return nil, err
+ }
+ options = append(options, libpod.WithExitCommand(exitCmd))
if c.HealthCheck != nil {
options = append(options, libpod.WithHealthCheck(c.HealthCheck))