ipcutil

package
v2.0.0-beta.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanUp

func CleanUp(ipc IPC) error

func EncodeIPCLabel

func EncodeIPCLabel(ipc IPC) (string, error)

EncodeIPCLabel encodes IPC spec into a label.

func GenerateIPCOpts

func GenerateIPCOpts(ctx context.Context, ipc IPC, client *containerd.Client) ([]oci.SpecOpts, error)

GenerateIPCOpts generates IPC spec opts from the given IPC.

Types

type IPC

type IPC struct {
	Mode IPCMode `json:"mode,omitempty"`
	// VictimContainer is only used when mode is container
	VictimContainerID *string `json:"victimContainerId,omitempty"`

	// HostShmPath is only used when mode is shareable
	HostShmPath *string `json:"hostShmPath,omitempty"`

	// ShmSize is only used when mode is private or shareable
	// Devshm size in bytes
	ShmSize string `json:"shmSize,omitempty"`
}

func DecodeIPCLabel

func DecodeIPCLabel(ipcLabel string) (IPC, error)

DecodeIPCLabel decodes IPC spec from a label. For backward compatibility, if ipcLabel is empty, it returns IPC{Mode: Private}.

func DetectFlags

func DetectFlags(ctx context.Context, client *containerd.Client, stateDir string, ipc string, shmSize string) (IPC, error)

DetectFlags detects IPC mode from the given ipc string and shmSize string. If ipc is empty, it returns IPC{Mode: Private}.

type IPCMode

type IPCMode string
const (
	Private   IPCMode = "private"
	Host      IPCMode = "host"
	Shareable IPCMode = "shareable"
	Container IPCMode = "container"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL