From 6f919af78ba19c63e005888276dbec635e38cc23 Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Mon, 16 Jan 2023 11:45:19 +0100 Subject: [PATCH] add a comment to container removal Every time I look at a container-removal issue I wonder why the container isn't locked directly here, so let's add a comment here. I am not sure whether I would be better if callers took care of locking but for now the comment will safe the future me and probably other readers some time. [NO NEW TESTS NEEDED] Signed-off-by: Valentin Rothberg --- libpod/runtime_ctr.go | 1 + 1 file changed, 1 insertion(+) diff --git a/libpod/runtime_ctr.go b/libpod/runtime_ctr.go index 4d13d7ffb1..15efdf07be 100644 --- a/libpod/runtime_ctr.go +++ b/libpod/runtime_ctr.go @@ -608,6 +608,7 @@ func (r *Runtime) setupContainer(ctx context.Context, ctr *Container) (_ *Contai // be removed also if and only if the container is the sole user // Otherwise, RemoveContainer will return an error if the container is running func (r *Runtime) RemoveContainer(ctx context.Context, c *Container, force bool, removeVolume bool, timeout *uint) error { + // NOTE: container will be locked down the road. return r.removeContainer(ctx, c, force, removeVolume, false, false, timeout) }