MCPcopy Index your code
hub / github.com/containerd/containerd / WithPidNamespace

Function WithPidNamespace

integration/main_test.go:453–467  ·  view source on GitHub ↗

Add pid namespace mode.

(mode runtime.NamespaceMode)

Source from the content-addressed store, hash-verified

451
452// Add pid namespace mode.
453func WithPidNamespace(mode runtime.NamespaceMode) ContainerOpts {
454 return func(c *runtime.ContainerConfig) {
455 if c.Linux == nil {
456 c.Linux = &runtime.LinuxContainerConfig{}
457 }
458 if c.Linux.SecurityContext == nil {
459 c.Linux.SecurityContext = &runtime.LinuxContainerSecurityContext{}
460 }
461 if c.Linux.SecurityContext.NamespaceOptions == nil {
462 c.Linux.SecurityContext.NamespaceOptions = &runtime.NamespaceOption{}
463 }
464 c.Linux.SecurityContext.NamespaceOptions.Pid = mode
465 }
466
467}
468
469// Add user namespace pod mode.
470func WithUserNamespace(containerID, hostID, length uint32) ContainerOpts {

Callers 1

TestContainerdRestartFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…