Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
sandbox: expose share sandbox pidns setting
Browse files Browse the repository at this point in the history
So that we let callers decide if kata-agent should let all containers in
a sandbox share the same pid namespace.

This will be first used only by frakti. And kata cli can possibly use it
as well when cri-o and containerd-cri stop creating pause containers
and just pass the CreateSandbox CRI requests to kata.

Fixes: #426

Signed-off-by: Peng Tao <[email protected]>
  • Loading branch information
bergwolf committed Jun 20, 2018
1 parent c324b55 commit 2b94252
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion virtcontainers/kata_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ func (k *kataAgent) startSandbox(sandbox *Sandbox) error {
req := &grpc.CreateSandboxRequest{
Hostname: hostname,
Storages: storages,
SandboxPidns: false,
SandboxPidns: sandbox.sharePidNs,
}

_, err = k.sendReq(req)
Expand Down
7 changes: 6 additions & 1 deletion virtcontainers/sandbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,9 @@ type SandboxConfig struct {
Annotations map[string]string

ShmSize uint64

// SharePidNs sets all containers to share the same sandbox level pid namespace.
SharePidNs bool
}

// valid checks that the sandbox configuration is valid.
Expand Down Expand Up @@ -462,7 +465,8 @@ type Sandbox struct {

wg *sync.WaitGroup

shmSize uint64
shmSize uint64
sharePidNs bool
}

// ID returns the sandbox identifier string.
Expand Down Expand Up @@ -743,6 +747,7 @@ func newSandbox(sandboxConfig SandboxConfig) (*Sandbox, error) {
annotationsLock: &sync.RWMutex{},
wg: &sync.WaitGroup{},
shmSize: sandboxConfig.ShmSize,
sharePidNs: sandboxConfig.SharePidNs,
}

if err = globalSandboxList.addSandbox(s); err != nil {
Expand Down

0 comments on commit 2b94252

Please sign in to comment.