Merge pull request #24082 from Luap99/netns-leak

Fix netns leak on container creation and exit code 1 on SIGTERM.
This commit is contained in:
openshift-merge-bot[bot]
2024-10-01 21:02:05 +00:00
committed by GitHub
4 changed files with 21 additions and 33 deletions

View File

@ -197,7 +197,13 @@ func (s *APIServer) Serve() error {
s.setupPprof()
if err := shutdown.Register("service", func(sig os.Signal) error {
return s.Shutdown(true)
err := s.Shutdown(true)
if err == nil {
// For `systemctl stop podman.service` support, exit code should be 0
// but only if we did indeed gracefully shutdown
shutdown.SetExitCode(0)
}
return err
}); err != nil {
return err
}