mirror of
https://github.com/containers/podman.git
synced 2025-05-20 16:47:39 +08:00

The podman healthchecks are implemented using systemd timers, this works great but it will never work on non systemd distros. Currently the logic always assumes systemd is available and will fail with an error, so users are forced to always run with `--no-healthcheck` to disable healthchecks that are defined in an image for example. This is annoying and IMO unnecessary, we should just default to no healthcheck on these systems. First, use the systemd build tag to disable it at build time if this tag is not used. Second, use make sure systemd is used as init before trying to use healthchecks. This could be the case when we are run in a container. [NO NEW TESTS NEEDED] We do not have any non systemd VMs in CI AFAIK. Fixes #16644 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
25 lines
543 B
Go
25 lines
543 B
Go
//go:build !systemd
|
|
// +build !systemd
|
|
|
|
package libpod
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
// createTimer systemd timers for healthchecks of a container
|
|
func (c *Container) createTimer(interval string, isStartup bool) error {
|
|
return nil
|
|
}
|
|
|
|
// startTimer starts a systemd timer for the healthchecks
|
|
func (c *Container) startTimer(isStartup bool) error {
|
|
return nil
|
|
}
|
|
|
|
// removeTransientFiles removes the systemd timer and unit files
|
|
// for the container
|
|
func (c *Container) removeTransientFiles(ctx context.Context, isStartup bool) error {
|
|
return nil
|
|
}
|