Merge pull request #8438 from MarcoPolo/marco/set-path-for-systemd-healthcheck

Set PATH env in systemd timer.
This commit is contained in:
OpenShift Merge Robot
2020-11-23 21:33:05 +01:00
committed by GitHub

View File

@ -26,6 +26,10 @@ func (c *Container) createTimer() error {
if rootless.IsRootless() {
cmd = append(cmd, "--user")
}
path := os.Getenv("PATH")
if path != "" {
cmd = append(cmd, "--setenv=PATH="+path)
}
cmd = append(cmd, "--unit", c.ID(), fmt.Sprintf("--on-unit-inactive=%s", c.HealthCheckConfig().Interval.String()), "--timer-property=AccuracySec=1s", podman, "healthcheck", "run", c.ID())
conn, err := systemd.ConnectToDBUS()