handler

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PouchEndpointSubFilepath = "pouchcri.sock"
)

Variables

View Source
var GetDockerClient = createDockerClient // for test
View Source
var (
	GrpcDial = grpc.DialContext // for test
)

Functions

func GetContainerdEndpoint added in v1.3.0

func GetContainerdEndpoint() string

func GetContainerdEndpoint2 added in v1.3.0

func GetContainerdEndpoint2() string

func GetCrioEndpoint added in v1.5.0

func GetCrioEndpoint() string

func GetCrioEndpoint2 added in v1.5.0

func GetCrioEndpoint2() string

func GetDockerEndpoint added in v1.3.0

func GetDockerEndpoint() string

func GetPouchEndpoint added in v1.4.0

func GetPouchEndpoint() string

Types

type ContainerRuntimeHandler

type ContainerRuntimeHandler interface {
	StopContainer(ctx context.Context, containerID string, timeout int64) error
	UpdateContainerResources(containerID string, opts UpdateOptions) error
}

func NewContainerdRuntimeHandler

func NewContainerdRuntimeHandler(endpoint string) (ContainerRuntimeHandler, error)

func NewCrioRuntimeHandler added in v1.5.0

func NewCrioRuntimeHandler(endpoint string) (ContainerRuntimeHandler, error)

func NewDockerRuntimeHandler

func NewDockerRuntimeHandler(endpoint string) (ContainerRuntimeHandler, error)

func NewFakeRuntimeHandler

func NewFakeRuntimeHandler() ContainerRuntimeHandler

func NewPouchRuntimeHandler added in v1.4.0

func NewPouchRuntimeHandler(endpoint string) (ContainerRuntimeHandler, error)

type ContainerdRuntimeHandler

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

func (*ContainerdRuntimeHandler) StopContainer

func (c *ContainerdRuntimeHandler) StopContainer(con context.Context, containerID string, timeout int64) error

func (*ContainerdRuntimeHandler) UpdateContainerResources

func (c *ContainerdRuntimeHandler) UpdateContainerResources(containerID string, opts UpdateOptions) error

type CrioRuntimeHandler added in v1.5.0

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

func (*CrioRuntimeHandler) StopContainer added in v1.5.0

func (c *CrioRuntimeHandler) StopContainer(ctx context.Context, containerID string, timeout int64) error

func (*CrioRuntimeHandler) UpdateContainerResources added in v1.5.0

func (c *CrioRuntimeHandler) UpdateContainerResources(containerID string, opts UpdateOptions) error

type DockerRuntimeHandler

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

func (*DockerRuntimeHandler) StopContainer

func (d *DockerRuntimeHandler) StopContainer(c context.Context, containerID string, timeout int64) error

func (*DockerRuntimeHandler) UpdateContainerResources

func (d *DockerRuntimeHandler) UpdateContainerResources(containerID string, opts UpdateOptions) error

type FakeRuntimeHandler

type FakeRuntimeHandler struct {
	PodMetas map[string]*statesinformer.PodMeta
	// contains filtered or unexported fields
}

func (*FakeRuntimeHandler) SetFakeContainers

func (f *FakeRuntimeHandler) SetFakeContainers(containers []*testing.FakeContainer)

func (*FakeRuntimeHandler) StopContainer

func (f *FakeRuntimeHandler) StopContainer(ctx context.Context, containerID string, timeout int64) error

func (*FakeRuntimeHandler) UpdateContainerResources

func (f *FakeRuntimeHandler) UpdateContainerResources(containerID string, opts UpdateOptions) error

type PouchRuntimeHandler added in v1.4.0

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

func (*PouchRuntimeHandler) StopContainer added in v1.4.0

func (c *PouchRuntimeHandler) StopContainer(ctx context.Context, containerID string, timeout int64) error

func (*PouchRuntimeHandler) UpdateContainerResources added in v1.4.0

func (c *PouchRuntimeHandler) UpdateContainerResources(containerID string, opts UpdateOptions) error

type UpdateOptions

type UpdateOptions struct {
	// CPU CFS (Completely Fair Scheduler) period. Default: 0 (not specified).
	CPUPeriod int64
	// CPU CFS (Completely Fair Scheduler) quota. Default: 0 (not specified).
	CPUQuota int64
	// CPU shares (relative weight vs. other containers). Default: 0 (not specified).
	CPUShares int64
	// Memory limit in bytes. Default: 0 (not specified).
	MemoryLimitInBytes int64
	// OOMScoreAdj adjusts the oom-killer score. Default: 0 (not specified).
	OomScoreAdj int64
	// CpuSetCpus constrains the allowed set of logical CPUs. Default: "" (not specified).
	CpusetCpus string
	// CpuSetMems constrains the allowed set of memory nodes. Default: "" (not specified).
	CpusetMems string
	// SpecAnnotationFilePath is the file path to specAnnotations. In JSON|Yaml format.
	SpecAnnotationFilePath string
}

Directories

Path Synopsis
Package mock_client is a generated GoMock package.
Package mock_client is a generated GoMock package.

Jump to

Keyboard shortcuts

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