diff options
Diffstat (limited to 'pkg/sentry/kernel/task.go')
-rw-r--r-- | pkg/sentry/kernel/task.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/pkg/sentry/kernel/task.go b/pkg/sentry/kernel/task.go index 2f6f825ac..07ad1614c 100644 --- a/pkg/sentry/kernel/task.go +++ b/pkg/sentry/kernel/task.go @@ -205,6 +205,13 @@ type Task struct { // k is the Kernel that this task belongs to. The k pointer is immutable. k *Kernel + // containerID has no equivalent in Linux; it's used by runsc to track all + // tasks that belong to a given containers since cgroups aren't implemented. + // It's inherited by the children, is immutable, and may be empty. + // + // NOTE: cgroups can be used to track this when implemented. + containerID string + // mu protects some of the following fields. mu sync.Mutex `state:"nosave"` @@ -678,3 +685,8 @@ func (t *Task) MountNamespace() *fs.MountNamespace { func (t *Task) AbstractSockets() *AbstractSocketNamespace { return t.abstractSockets } + +// ContainerID returns t's container ID. +func (t *Task) ContainerID() string { + return t.containerID +} |