diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-05-02 11:53:30 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-02 11:53:30 -0400 |
commit | c3d871a3f6cc7a94c5e86782ba63e05cd1d2faeb (patch) | |
tree | 589ce895fa6ab9ab7a605ea5016307d9915c74a2 /libpod/runtime.go | |
parent | adf6ee671ff8111b3b1d1819a65fcc05e44589ef (diff) | |
parent | 4eff0c8cf284a6007122aec731e4d97059750166 (diff) | |
download | podman-c3d871a3f6cc7a94c5e86782ba63e05cd1d2faeb.tar.gz podman-c3d871a3f6cc7a94c5e86782ba63e05cd1d2faeb.tar.bz2 podman-c3d871a3f6cc7a94c5e86782ba63e05cd1d2faeb.zip |
Merge pull request #13859 from vrothberg/fix-13464
pod: add exit policies
Diffstat (limited to 'libpod/runtime.go')
-rw-r--r-- | libpod/runtime.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libpod/runtime.go b/libpod/runtime.go index 6c2323d88..d5daa2f8a 100644 --- a/libpod/runtime.go +++ b/libpod/runtime.go @@ -86,6 +86,10 @@ type Runtime struct { libimageEventsShutdown chan bool lockManager lock.Manager + // Worker + workerShutdown chan bool + workerChannel chan func() + // syslog describes whenever logrus should log to the syslog as well. // Note that the syslog hook will be enabled early in cmd/podman/syslog_linux.go // This bool is just needed so that we can set it for netavark interface. @@ -597,6 +601,8 @@ func makeRuntime(runtime *Runtime) (retErr error) { } } + runtime.startWorker() + // Mark the runtime as valid - ready to be used, cannot be modified // further runtime.valid = true @@ -817,6 +823,14 @@ func (r *Runtime) Shutdown(force bool) error { return define.ErrRuntimeStopped } + if r.workerShutdown != nil { + // Signal the worker routine to shutdown. The routine will + // process all pending work items and then read from the + // channel; we're blocked until all work items have been + // processed. + r.workerShutdown <- true + } + r.valid = false // Shutdown all containers if --force is given |