rootless: propagate XDG_RUNTIME_DIR to the OCI runtime

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano 2018-11-27 21:18:44 +01:00
parent d837dd3e2a
commit 1d2e1eece5
No known key found for this signature in database
GPG Key ID: E4730F97F60286ED
1 changed files with 6 additions and 2 deletions

View File

@ -696,8 +696,12 @@ func (r *OCIRuntime) stopContainer(ctr *Container, timeout uint) error {
// deleteContainer deletes a container from the OCI runtime
func (r *OCIRuntime) deleteContainer(ctr *Container) error {
_, err := utils.ExecCmd(r.path, "delete", "--force", ctr.ID())
return err
runtimeDir, err := util.GetRootlessRuntimeDir()
if err != nil {
return err
}
env := []string{fmt.Sprintf("XDG_RUNTIME_DIR=%s", runtimeDir)}
return utils.ExecCmdWithStdStreams(os.Stdin, os.Stdout, os.Stderr, env, r.path, "delete", "--force", ctr.ID())
}
// pauseContainer pauses the given container