summaryrefslogtreecommitdiff
path: root/pkg/spec
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2018-10-11 11:49:45 -0700
committerGitHub <noreply@github.com>2018-10-11 11:49:45 -0700
commit5f6e4cc830e82a9453e4617d6b8dccab30700f3d (patch)
tree3564b983576c189de175bdc80df05bad2c1d9609 /pkg/spec
parent6d8bc879cbcb6673043084658e0facc1752736ad (diff)
parentf87f0abb77f27a868d03656cf0458e2f0a88ca5f (diff)
downloadpodman-5f6e4cc830e82a9453e4617d6b8dccab30700f3d.tar.gz
podman-5f6e4cc830e82a9453e4617d6b8dccab30700f3d.tar.bz2
podman-5f6e4cc830e82a9453e4617d6b8dccab30700f3d.zip
Merge pull request #1605 from mheon/syslog_cleanup
Pass along syslog variable to podman cleanup processes
Diffstat (limited to 'pkg/spec')
-rw-r--r--pkg/spec/createconfig.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/pkg/spec/createconfig.go b/pkg/spec/createconfig.go
index e9a5dc9dc..d34b21189 100644
--- a/pkg/spec/createconfig.go
+++ b/pkg/spec/createconfig.go
@@ -134,6 +134,7 @@ type CreateConfig struct {
SecurityOpts []string
Rootfs string
LocalVolumes []string //Keeps track of the built-in volumes of container used in the --volumes-from flag
+ Syslog bool // Whether to enable syslog on exit commands
}
func u32Ptr(i int64) *uint32 { u := uint32(i); return &u }
@@ -288,8 +289,8 @@ func (c *CreateConfig) GetTmpfsMounts() []spec.Mount {
return m
}
-func createExitCommand(runtime *libpod.Runtime) []string {
- config := runtime.GetConfig()
+func (c *CreateConfig) createExitCommand() []string {
+ config := c.Runtime.GetConfig()
cmd, _ := os.Executable()
command := []string{cmd,
@@ -302,6 +303,9 @@ func createExitCommand(runtime *libpod.Runtime) []string {
if config.StorageConfig.GraphDriverName != "" {
command = append(command, []string{"--storage-driver", config.StorageConfig.GraphDriverName}...)
}
+ if c.Syslog {
+ command = append(command, "--syslog")
+ }
return append(command, []string{"container", "cleanup"}...)
}
@@ -481,7 +485,7 @@ func (c *CreateConfig) GetContainerCreateOptions(runtime *libpod.Runtime) ([]lib
options = append(options, libpod.WithCgroupParent(c.CgroupParent))
}
if c.Detach {
- options = append(options, libpod.WithExitCommand(createExitCommand(runtime)))
+ options = append(options, libpod.WithExitCommand(c.createExitCommand()))
}
return options, nil