summaryrefslogtreecommitdiff
path: root/libpod/runtime_ctr.go
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2021-11-18 20:22:33 +0100
committerPaul Holzinger <pholzing@redhat.com>2021-11-18 20:28:03 +0100
commit0dae50f1d3af16e625ca7e2f272fb2ce63682c83 (patch)
tree6f5b41f9b6cf1b39fb7d530a059e777a81017f21 /libpod/runtime_ctr.go
parent0376e6092c850435b4740876045fdccb467cafd8 (diff)
downloadpodman-0dae50f1d3af16e625ca7e2f272fb2ce63682c83.tar.gz
podman-0dae50f1d3af16e625ca7e2f272fb2ce63682c83.tar.bz2
podman-0dae50f1d3af16e625ca7e2f272fb2ce63682c83.zip
Do not store the exit command in container config
There is a problem with creating and storing the exit command when the container was created. It only contains the options the container was created with but NOT the options the container is started with. One example would be a CNI network config. If I start a container once, then change the cni config dir with `--cni-config-dir` ans start it a second time it will start successfully. However the exit command still contains the wrong `--cni-config-dir` because it was not updated. To fix this we do not want to store the exit command at all. Instead we create it every time the conmon process for the container is startet. This guarantees us that the container cleanup process is startet with the correct settings. [NO NEW TESTS NEEDED] Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'libpod/runtime_ctr.go')
-rw-r--r--libpod/runtime_ctr.go2
1 files changed, 0 insertions, 2 deletions
diff --git a/libpod/runtime_ctr.go b/libpod/runtime_ctr.go
index 114bf9315..05f22c1fe 100644
--- a/libpod/runtime_ctr.go
+++ b/libpod/runtime_ctr.go
@@ -186,8 +186,6 @@ func (r *Runtime) initContainerVariables(rSpec *spec.Spec, config *ContainerConf
// If the ID is empty a new name for the restored container was requested
if ctr.config.ID == "" {
ctr.config.ID = stringid.GenerateNonCryptoID()
- // Fixup ExitCommand with new ID
- ctr.config.ExitCommand[len(ctr.config.ExitCommand)-1] = ctr.config.ID
}
// Reset the log path to point to the default
ctr.config.LogPath = ""