diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-09-13 14:22:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-13 14:22:34 +0200 |
commit | 351b30311904089c70ae449b941173a197d6066f (patch) | |
tree | 02558bcd46a1baef4a76114e39328ae9b463342c /libpod | |
parent | d88d74639fbabfd83663ea94a11c11c7a54b781b (diff) | |
parent | c8c2aab50d73ab767b8eb720b4d1abbc9bb36b62 (diff) | |
download | podman-351b30311904089c70ae449b941173a197d6066f.tar.gz podman-351b30311904089c70ae449b941173a197d6066f.tar.bz2 podman-351b30311904089c70ae449b941173a197d6066f.zip |
Merge pull request #15752 from vrothberg/fix-15691
health checks: restart timers
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/container_internal.go | 6 | ||||
-rw-r--r-- | libpod/healthcheck_linux.go | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go index a7ea3c5c5..994243805 100644 --- a/libpod/container_internal.go +++ b/libpod/container_internal.go @@ -1286,6 +1286,12 @@ func (c *Container) stop(timeout uint) error { c.lock.Unlock() } + if c.config.HealthCheckConfig != nil { + if err := c.removeTransientFiles(context.Background()); err != nil { + logrus.Error(err.Error()) + } + } + stopErr := c.ociRuntime.StopContainer(c, timeout, all) if !c.batched { diff --git a/libpod/healthcheck_linux.go b/libpod/healthcheck_linux.go index 3fb6dfb91..6948f976a 100644 --- a/libpod/healthcheck_linux.go +++ b/libpod/healthcheck_linux.go @@ -70,7 +70,7 @@ func (c *Container) startTimer() error { startFile := fmt.Sprintf("%s.service", c.ID()) startChan := make(chan string) - if _, err := conn.StartUnitContext(context.Background(), startFile, "fail", startChan); err != nil { + if _, err := conn.RestartUnitContext(context.Background(), startFile, "fail", startChan); err != nil { return err } if err := systemdOpSuccessful(startChan); err != nil { |