Documentation
¶
Index ¶
- Constants
- Variables
- func DefaultMemorySwap() int64
- func FmtDockerOpts(opts []DockerOpt, sep rune) []string
- func NewDockerFilter(args *dockerfilters.Args) *dockerFilter
- func NewDockerServiceAlpha(ds DockerService) v1AlphaCRIService
- func SharedLimitWriter(w io.Writer, limit *int64) io.Writer
- type CRIService
- type Checkpoint
- type CheckpointData
- type ContainerCheckpoint
- type DockerOpt
- type DockerService
- type NativeExecHandler
- type PodSandboxCheckpoint
- type SharedWriteLimiter
Constants ¶
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 ¶
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 ¶
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
Types ¶
type CRIService ¶
type CRIService interface { runtimeapi.RuntimeServiceServer runtimeapi.ImageServiceServer }
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 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 ¶
func (cp *PodSandboxCheckpoint) GetData() (string, string, string, []*config.PortMapping, bool)
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.
Source Files
¶
- checkpoint.go
- container_attach.go
- container_create.go
- container_exec.go
- container_list.go
- container_remove.go
- container_start.go
- container_status.go
- container_stop.go
- container_update_resources.go
- convert.go
- docker_service.go
- exec.go
- helpers.go
- helpers_linux.go
- image.go
- imagefs.go
- imagefs_linux.go
- logs.go
- naming.go
- sandbox_helpers.go
- sandbox_list.go
- sandbox_port_forward.go
- sandbox_remove.go
- sandbox_run.go
- sandbox_status.go
- sandbox_stop.go
- security_context.go
- security_context_linux.go
- selinux_util.go
- service_alpha.go
- stats.go
- stats_linux.go