diff options
author | Matthew Heon <mheon@redhat.com> | 2022-10-05 09:21:16 -0400 |
---|---|---|
committer | Matthew Heon <mheon@redhat.com> | 2022-10-05 09:21:16 -0400 |
commit | e136376d1f898303fb059cad729e2d65578a4c8c (patch) | |
tree | f645c4ec0c763c1ec51c4d1ff9473db59c681cc5 /pkg/domain | |
parent | f52feded3ce6c1ad2af046ab774fbc2b9c832487 (diff) | |
download | podman-e136376d1f898303fb059cad729e2d65578a4c8c.tar.gz podman-e136376d1f898303fb059cad729e2d65578a4c8c.tar.bz2 podman-e136376d1f898303fb059cad729e2d65578a4c8c.zip |
Clean up when stopping pods
We have a test to verify that init containers in pods are
deleted when the `--init-ctr=once` option is specified. The test
creates two containers, one of them an init container, starts the
pod, stops the pod, and restarts the pod, checking for the
presence of a file created by the init container during the
second start. We're seeing a race where the file still exists,
which I'm fairly certain comes down to the SHM mount not being
cleaned up after the pod is stopped.
Fortunately, we already have code to do this - just flip the bool
that controls cleanup from false to true.
[NO NEW TESTS NEEDED] Fixes a difficult to reproduce race
condition.
Fixes #16046
Signed-off-by: Matthew Heon <mheon@redhat.com>
Diffstat (limited to 'pkg/domain')
-rw-r--r-- | pkg/domain/infra/abi/pods.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/domain/infra/abi/pods.go b/pkg/domain/infra/abi/pods.go index 45a47b46e..4b269d925 100644 --- a/pkg/domain/infra/abi/pods.go +++ b/pkg/domain/infra/abi/pods.go @@ -195,7 +195,7 @@ func (ic *ContainerEngine) PodStop(ctx context.Context, namesOrIds []string, opt } for _, p := range pods { report := entities.PodStopReport{Id: p.ID()} - errs, err := p.StopWithTimeout(ctx, false, options.Timeout) + errs, err := p.StopWithTimeout(ctx, true, options.Timeout) if err != nil && !errors.Is(err, define.ErrPodPartialFail) { report.Errs = []error{err} reports = append(reports, &report) |