Removed .service file for healthchecks

when a container with healthchecks exits due to stopping or failure, we
need the cleanup process to remove both the timer file and the service
file.

Bz#:2024229

Signed-off-by: Brent Baude <bbaude@redhat.com>
This commit is contained in:
Brent Baude
2021-12-16 13:55:08 -06:00
parent 273da42af2
commit e88c21366d
3 changed files with 34 additions and 10 deletions

View File

@ -1877,7 +1877,7 @@ func (c *Container) cleanupStorage() error {
return cleanupErr
}
// Unmount the a container and free its resources
// Unmount the container and free its resources
func (c *Container) cleanup(ctx context.Context) error {
var lastError error
@ -1885,7 +1885,7 @@ func (c *Container) cleanup(ctx context.Context) error {
// Remove healthcheck unit/timer file if it execs
if c.config.HealthCheckConfig != nil {
if err := c.removeTimer(); err != nil {
if err := c.removeTransientFiles(ctx); err != nil {
logrus.Errorf("Removing timer for container %s healthcheck: %v", c.ID(), err)
}
}