aboutsummaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-06-25 03:11:03 -0400
committerGitHub <noreply@github.com>2020-06-25 03:11:03 -0400
commit35cca198b31582b75304e3614f8942b83a38422e (patch)
treea182e1b52a39557fc49e158b4af95e900b9f6218 /pkg
parent2df3faab7b2801cc2e3c2291b618ae530223329d (diff)
parent18300573f98883a4d6af09afe49a1e789e3a8f54 (diff)
downloadpodman-35cca198b31582b75304e3614f8942b83a38422e.tar.gz
podman-35cca198b31582b75304e3614f8942b83a38422e.tar.bz2
podman-35cca198b31582b75304e3614f8942b83a38422e.zip
Merge pull request #6713 from mheon/debug_level
Set syslog for exit commands on log-level=debug
Diffstat (limited to 'pkg')
-rw-r--r--pkg/api/handlers/compat/exec.go3
-rw-r--r--pkg/specgen/generate/container_create.go3
-rw-r--r--pkg/specgen/specgen.go2
3 files changed, 4 insertions, 4 deletions
diff --git a/pkg/api/handlers/compat/exec.go b/pkg/api/handlers/compat/exec.go
index 8f7016903..dae76c061 100644
--- a/pkg/api/handlers/compat/exec.go
+++ b/pkg/api/handlers/compat/exec.go
@@ -62,7 +62,8 @@ func ExecCreateHandler(w http.ResponseWriter, r *http.Request) {
utils.InternalServerError(w, err)
return
}
- exitCommandArgs, err := generate.CreateExitCommandArgs(storageConfig, runtimeConfig, false, true, true)
+ // Automatically log to syslog if the server has log-level=debug set
+ exitCommandArgs, err := generate.CreateExitCommandArgs(storageConfig, runtimeConfig, logrus.IsLevelEnabled(logrus.DebugLevel), true, true)
if err != nil {
utils.InternalServerError(w, err)
return
diff --git a/pkg/specgen/generate/container_create.go b/pkg/specgen/generate/container_create.go
index ea6f938a8..7b4fbebf4 100644
--- a/pkg/specgen/generate/container_create.go
+++ b/pkg/specgen/generate/container_create.go
@@ -114,8 +114,7 @@ func MakeContainer(ctx context.Context, rt *libpod.Runtime, s *specgen.SpecGener
}
options = append(options, opts...)
- // TODO: Enable syslog support - we'll need to put this in SpecGen.
- exitCommandArgs, err := CreateExitCommandArgs(rt.StorageConfig(), rtc, false, s.Remove, false)
+ exitCommandArgs, err := CreateExitCommandArgs(rt.StorageConfig(), rtc, logrus.IsLevelEnabled(logrus.DebugLevel), s.Remove, false)
if err != nil {
return nil, err
}
diff --git a/pkg/specgen/specgen.go b/pkg/specgen/specgen.go
index 46ff8c716..3d5bf03e5 100644
--- a/pkg/specgen/specgen.go
+++ b/pkg/specgen/specgen.go
@@ -129,7 +129,7 @@ type ContainerBasicConfig struct {
Sysctl map[string]string `json:"sysctl,omitempty"`
// Remove indicates if the container should be removed once it has been started
// and exits
- Remove bool `json:"remove"`
+ Remove bool `json:"remove,omitempty"`
// PreserveFDs is a number of additional file descriptors (in addition
// to 0, 1, 2) that will be passed to the executed process. The total FDs
// passed will be 3 + PreserveFDs.