diff options
author | Matthew Heon <matthew.heon@gmail.com> | 2018-02-27 22:52:28 -0500 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-03-01 21:17:51 +0000 |
commit | fa5f99effa7dd2ef9fbd5287b6225590b28713d1 (patch) | |
tree | 240a4696de8a499ed7489b67fcbdf4674ca87d19 /libpod/container_api.go | |
parent | 83d7ae6506f7aaf1f7d543412a148b4bf4cd6657 (diff) | |
download | podman-fa5f99effa7dd2ef9fbd5287b6225590b28713d1.tar.gz podman-fa5f99effa7dd2ef9fbd5287b6225590b28713d1.tar.bz2 podman-fa5f99effa7dd2ef9fbd5287b6225590b28713d1.zip |
Convert exec session tracking to use a dedicated struct
This will behave better if we need to add anything to it at a
later date - we can add fields to the struct without breaking
existing BoltDB databases.
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Closes: #412
Approved by: baude
Diffstat (limited to 'libpod/container_api.go')
-rw-r--r-- | libpod/container_api.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libpod/container_api.go b/libpod/container_api.go index e8185ae19..4203e8d44 100644 --- a/libpod/container_api.go +++ b/libpod/container_api.go @@ -307,9 +307,13 @@ func (c *Container) Exec(tty, privileged bool, env, cmd []string, user string) e // We have the PID, add it to state if c.state.ExecSessions == nil { - c.state.ExecSessions = make(map[string]int) + c.state.ExecSessions = make(map[string]*ExecSession) } - c.state.ExecSessions[sessionID] = int(pid) + session := new(ExecSession) + session.ID = sessionID + session.Command = cmd + session.PID = int(pid) + c.state.ExecSessions[sessionID] = session if err := c.save(); err != nil { // Now we have a PID but we can't save it in the DB // TODO handle this better |