core

package
v0.3.13 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 55 Imported by: 2

Documentation

Index

Constants

View Source
const (

	// DockerImageIDPrefix is the prefix of image id in container status.
	DockerImageIDPrefix = "docker://"
	// DockerPullableImageIDPrefix is the prefix of pullable image id in container status.
	DockerPullableImageIDPrefix = "docker-pullable://"
)

Variables

View Source
var ImageFsStatsCache utils.Cache

ImageFsStatsCache caches imagefs stats.

Functions

func DefaultMemorySwap

func DefaultMemorySwap() int64

DefaultMemorySwap always returns 0 for no memory swap in a sandbox

func FmtDockerOpts

func FmtDockerOpts(opts []DockerOpt, sep rune) []string

fmtDockerOpts formats the docker security options using the given separator.

func NewDockerFilter

func NewDockerFilter(args *dockerfilters.Args) *dockerFilter

func NewDockerServiceAlpha added in v0.3.0

func NewDockerServiceAlpha(ds DockerService) v1AlphaCRIService

func SharedLimitWriter

func SharedLimitWriter(w io.Writer, limit *int64) io.Writer

Types

type CRIService

CRIService includes all methods necessary for a CRI backend.

type Checkpoint

type Checkpoint interface {
	MarshalCheckpoint() ([]byte, error)
	UnmarshalCheckpoint(blob []byte) error
	VerifyChecksum() error
}

Checkpoint provides the process checkpoint data

type CheckpointData

type CheckpointData struct {
	PortMappings []*config.PortMapping `json:"port_mappings,omitempty"`
	HostNetwork  bool                  `json:"host_network,omitempty"`
}

CheckpointData contains all types of data that can be stored in the checkpoint.

type ContainerCheckpoint

type ContainerCheckpoint interface {
	Checkpoint
	GetData() (string, string, string, []*config.PortMapping, bool)
}

ContainerCheckpoint provides the interface for process container's checkpoint data

func NewPodSandboxCheckpoint

func NewPodSandboxCheckpoint(namespace, name string, data *CheckpointData) ContainerCheckpoint

NewPodSandboxCheckpoint inits a PodSandboxCheckpoint with the given args

type DockerOpt

type DockerOpt struct {
	// contains filtered or unexported fields
}

func (DockerOpt) GetKV

func (d DockerOpt) GetKV() (string, string)

GetKV exposes key/value from dockerOpt.

type DockerService

type DockerService interface {
	CRIService
	// contains filtered or unexported methods
}

DockerService is an interface that embeds the new RuntimeService and ImageService interfaces.

func NewDockerService

func NewDockerService(
	clientConfig *config.ClientConfig,
	podSandboxImage string,
	streamingConfig *streaming.Config,
	pluginSettings *config.NetworkPluginSettings,
	cgroupsName string,
	kubeCgroupDriver string,
	criDockerdRootDir string,
) (DockerService, error)

NewDockerService creates a new `DockerService`

type NativeExecHandler

type NativeExecHandler struct{}

NativeExecHandler executes commands in Docker containers using Docker's exec API.

func (*NativeExecHandler) ExecInContainer

func (*NativeExecHandler) ExecInContainer(
	ctx context.Context,
	client libdocker.DockerClientInterface,
	container *dockertypes.ContainerJSON,
	cmd []string,
	stdin io.Reader,
	stdout, stderr io.WriteCloser,
	tty bool,
	resize <-chan remotecommand.TerminalSize,
	timeout time.Duration,
) error

ExecInContainer executes the cmd in container using the Docker's exec API

type PodSandboxCheckpoint

type PodSandboxCheckpoint struct {
	// Version of the pod sandbox checkpoint schema.
	Version string `json:"version"`
	// Pod name of the sandbox. Same as the pod name in the Pod ObjectMeta.
	Name string `json:"name"`
	// Pod namespace of the sandbox. Same as the pod namespace in the Pod ObjectMeta.
	Namespace string `json:"namespace"`
	// Data to checkpoint for pod sandbox.
	Data *CheckpointData `json:"data,omitempty"`
	// Checksum is calculated with fnv hash of the checkpoint object with checksum field set to be zero
	Checksum store.Checksum `json:"checksum"`
}

PodSandboxCheckpoint is the checkpoint structure for a sandbox

func (*PodSandboxCheckpoint) GetData

GetData gets the PodSandboxCheckpoint's version and some net information

func (*PodSandboxCheckpoint) MarshalCheckpoint

func (cp *PodSandboxCheckpoint) MarshalCheckpoint() ([]byte, error)

MarshalCheckpoint encodes the PodSandboxCheckpoint instance to a json object

func (*PodSandboxCheckpoint) UnmarshalCheckpoint

func (cp *PodSandboxCheckpoint) UnmarshalCheckpoint(blob []byte) error

UnmarshalCheckpoint decodes the blob data to the PodSandboxCheckpoint instance

func (*PodSandboxCheckpoint) VerifyChecksum

func (cp *PodSandboxCheckpoint) VerifyChecksum() error

VerifyChecksum verifies whether the PodSandboxCheckpoint's data checksum is the same as calculated checksum

type SharedWriteLimiter

type SharedWriteLimiter struct {
	// contains filtered or unexported fields
}

sharedWriteLimiter limits the total output written across one or more streams.

func (SharedWriteLimiter) Write

func (w SharedWriteLimiter) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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