Skip to content

Commit

Permalink
Merge pull request #16115 from vrothberg/v4.1-backport-4dd67272ed17cf…
Browse files Browse the repository at this point in the history
…c4c0c1621a969ed66c432677c0

[v4.1.1-rhel] healthcheck: fix --on-failure=stop
  • Loading branch information
openshift-merge-robot committed Oct 11, 2022
2 parents 2e917df + 0922942 commit 7f5e2fd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libpod/container_internal.go
Expand Up @@ -1440,6 +1440,11 @@ func (c *Container) restartWithTimeout(ctx context.Context, timeout uint) (retEr
if err := c.stop(timeout); err != nil {
return err
}
if c.config.HealthCheckConfig != nil {
if err := c.removeTransientFiles(context.Background()); err != nil {
logrus.Error(err.Error())
}
}
// Old versions of conmon have a bug where they create the exit file before
// closing open file descriptors causing a race condition when restarting
// containers with open ports since we cannot bind the ports as they're not
Expand Down
3 changes: 3 additions & 0 deletions test/system/220-healthcheck.bats
Expand Up @@ -127,6 +127,9 @@ Log[-1].Output | \"Uh-oh on stdout!\\\nUh-oh on stderr!\"
if [[ "$output" == "running $policy" ]]; then
die "container is still in running mode"
fi
if [[ "$output" == "stopping $policy" ]]; then
die "container should not be in stopping state"
fi
fi

run_podman rm -f -t0 $ctr
Expand Down

0 comments on commit 7f5e2fd

Please sign in to comment.