mirror of
https://github.com/containers/podman.git
synced 2025-05-21 09:05:56 +08:00
healthchecks: return systemd-run error
In case `systemd-run` errors when creating transient unit files (and timers), create an error based on the combined output from stdout and stderr. Using the error from `exec.Command` contains the exit code only which is not useful to debug (see #7484). Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
@ -35,9 +35,8 @@ func (c *Container) createTimer() error {
|
|||||||
conn.Close()
|
conn.Close()
|
||||||
logrus.Debugf("creating systemd-transient files: %s %s", "systemd-run", cmd)
|
logrus.Debugf("creating systemd-transient files: %s %s", "systemd-run", cmd)
|
||||||
systemdRun := exec.Command("systemd-run", cmd...)
|
systemdRun := exec.Command("systemd-run", cmd...)
|
||||||
_, err = systemdRun.CombinedOutput()
|
if output, err := systemdRun.CombinedOutput(); err != nil {
|
||||||
if err != nil {
|
return errors.Errorf("%s", output)
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user