Merge pull request #427 from bergwolf/sandbox_ns

sandbox: expose share sandbox pidns setting
This commit is contained in:
Archana Shinde 2018-06-20 09:27:13 -07:00 committed by GitHub
commit d02babdf81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -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)

View File

@ -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.
@ -463,6 +466,7 @@ type Sandbox struct {
wg *sync.WaitGroup
shmSize uint64
sharePidNs bool
}
// ID returns the sandbox identifier string.
@ -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 {