Add tracking for exec session IDs

Exec sessions now have an ID generated and assigned to their PID
and stored in the database state. This allows us to track what
exec sessions are currently active.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #412
Approved by: baude
This commit is contained in:
Matthew Heon
2018-02-27 13:51:43 -05:00
committed by Atomic Bot
parent aea4f24919
commit 8b87a17f56
5 changed files with 135 additions and 8 deletions

View File

@ -20,6 +20,11 @@ func (c *Container) getContainerInspectData(size bool, driverData *inspect.Data)
args = args[1:]
}
execIDs := []string{}
for id, _ := range c.state.ExecSessions {
execIDs = append(execIDs, id)
}
data := &inspect.ContainerInspectData{
ID: config.ID,
Created: config.CreatedTime,
@ -50,7 +55,7 @@ func (c *Container) getContainerInspectData(size bool, driverData *inspect.Data)
MountLabel: config.MountLabel,
ProcessLabel: spec.Process.SelinuxLabel,
AppArmorProfile: spec.Process.ApparmorProfile,
ExecIDs: []string{}, //TODO
ExecIDs: execIDs,
GraphDriver: driverData,
Mounts: spec.Mounts,
NetworkSettings: &inspect.NetworkSettings{