forked from containers/podman
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
disable healthchecks automatically on non systemd systems
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 containers#16644 Signed-off-by: Paul Holzinger <[email protected]>
- Loading branch information
Showing
3 changed files
with
52 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
//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 | ||
} |