Skip to content

Commit

Permalink
Merge pull request #16785 from vrothberg/fix-14531
Browse files Browse the repository at this point in the history
health check: ignore dependencies of transient systemd units/timers
  • Loading branch information
openshift-merge-robot authored Dec 9, 2022
2 parents 7d2a19c + 1ed9827 commit 205cb50
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libpod/healthcheck_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func (c *Container) removeTransientFiles(ctx context.Context, isStartup bool) er
// fire after the service is stopped.
timerChan := make(chan string)
timerFile := fmt.Sprintf("%s.timer", c.hcUnitName(isStartup))
if _, err := conn.StopUnitContext(ctx, timerFile, "fail", timerChan); err != nil {
if _, err := conn.StopUnitContext(ctx, timerFile, "ignore-dependencies", timerChan); err != nil {
if !strings.HasSuffix(err.Error(), ".timer not loaded.") {
stopErrors = append(stopErrors, fmt.Errorf("removing health-check timer %q: %w", timerFile, err))
}
Expand All @@ -126,7 +126,7 @@ func (c *Container) removeTransientFiles(ctx context.Context, isStartup bool) er
if err := conn.ResetFailedUnitContext(ctx, serviceFile); err != nil {
logrus.Debugf("Failed to reset unit file: %q", err)
}
if _, err := conn.StopUnitContext(ctx, serviceFile, "fail", serviceChan); err != nil {
if _, err := conn.StopUnitContext(ctx, serviceFile, "ignore-dependencies", serviceChan); err != nil {
if !strings.HasSuffix(err.Error(), ".service not loaded.") {
stopErrors = append(stopErrors, fmt.Errorf("removing health-check service %q: %w", serviceFile, err))
}
Expand Down

0 comments on commit 205cb50

Please sign in to comment.