Merge pull request #6713 from mheon/debug_level

Set syslog for exit commands on log-level=debug
This commit is contained in:
OpenShift Merge Robot
2020-06-25 03:11:03 -04:00
committed by GitHub
3 changed files with 4 additions and 4 deletions

View File

@ -62,7 +62,8 @@ func ExecCreateHandler(w http.ResponseWriter, r *http.Request) {
utils.InternalServerError(w, err) utils.InternalServerError(w, err)
return 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 { if err != nil {
utils.InternalServerError(w, err) utils.InternalServerError(w, err)
return return

View File

@ -114,8 +114,7 @@ func MakeContainer(ctx context.Context, rt *libpod.Runtime, s *specgen.SpecGener
} }
options = append(options, opts...) options = append(options, opts...)
// TODO: Enable syslog support - we'll need to put this in SpecGen. exitCommandArgs, err := CreateExitCommandArgs(rt.StorageConfig(), rtc, logrus.IsLevelEnabled(logrus.DebugLevel), s.Remove, false)
exitCommandArgs, err := CreateExitCommandArgs(rt.StorageConfig(), rtc, false, s.Remove, false)
if err != nil { if err != nil {
return nil, err return nil, err
} }

View File

@ -129,7 +129,7 @@ type ContainerBasicConfig struct {
Sysctl map[string]string `json:"sysctl,omitempty"` Sysctl map[string]string `json:"sysctl,omitempty"`
// Remove indicates if the container should be removed once it has been started // Remove indicates if the container should be removed once it has been started
// and exits // and exits
Remove bool `json:"remove"` Remove bool `json:"remove,omitempty"`
// PreserveFDs is a number of additional file descriptors (in addition // 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 // to 0, 1, 2) that will be passed to the executed process. The total FDs
// passed will be 3 + PreserveFDs. // passed will be 3 + PreserveFDs.