containerutil

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LabelRole = "arhat.dev/role"

	LabelRoleValueAbbot = "Abbot"
)
View Source
const (
	ContainerLabelPodNamespace     = "ctr.arhat.dev/pod-namespace"
	ContainerLabelPodName          = "ctr.arhat.dev/pod-name"
	ContainerLabelPodUID           = "ctr.arhat.dev/pod-uid"
	ContainerLabelHostNetwork      = "config.ctr.arhat.dev/host-network"
	ContainerLabelPodContainer     = "ctr.arhat.dev/pod-container"
	ContainerLabelPodContainerRole = "ctr.arhat.dev/pod-container-role"

	ContainerRoleInfra = "infra"
	ContainerRoleWork  = "work"
)

labels used by container runtime

View Source
const (
	ContainerNamePause = "_pause"
	ContainerNameAbbot = "abbot"
)
View Source
const (
	DefaultDockerImageDomain    = "docker.io"
	DefaultDockerImageNamespace = "library"
)

Variables

This section is empty.

Functions

func AbbotMatchLabels

func AbbotMatchLabels() map[string]string

func CollectErrors

func CollectErrors(errCh <-chan error) error

func ContainerLabels

func ContainerLabels(options *runtimepb.PodEnsureCmd, container string) map[string]string

func GenerateImageName

func GenerateImageName(defaultDomain, defaultNamespace, name string) string

GenerateImageName create a image name with defaults according to provided name defaultDomain MUST NOT be empty

func GetContainerName

func GetContainerName(namespace, name, container string) string

func GetEnv

func GetEnv(env []string) map[string]string

func IsAbbotPod

func IsAbbotPod(labels map[string]string) bool

func IsHostNetwork

func IsHostNetwork(labels map[string]string) bool

func IsPauseContainer

func IsPauseContainer(labels map[string]string) bool

func SharedNamespaces

func SharedNamespaces(pauseCtrID string, options *runtimepb.PodEnsureCmd) map[string]string

nolint:goconst

Types

type BaseRuntime

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

func NewBaseRuntime

func NewBaseRuntime(
	ctx context.Context,
	dataDir string,
	imageActionTimeout, podActionTimeout time.Duration,
	name, version, os, osImage, arch, kernelVersion string,
) *BaseRuntime

func (*BaseRuntime) ActionContext

func (r *BaseRuntime) ActionContext(ctx context.Context) (context.Context, context.CancelFunc)

func (*BaseRuntime) Arch

func (r *BaseRuntime) Arch() string

func (*BaseRuntime) ImageActionContext

func (r *BaseRuntime) ImageActionContext(ctx context.Context) (context.Context, context.CancelFunc)

func (*BaseRuntime) KernelVersion

func (r *BaseRuntime) KernelVersion() string

func (*BaseRuntime) Name

func (r *BaseRuntime) Name() string

func (*BaseRuntime) OS

func (r *BaseRuntime) OS() string

func (*BaseRuntime) OSImage

func (r *BaseRuntime) OSImage() string

func (*BaseRuntime) PodActionContext

func (r *BaseRuntime) PodActionContext(ctx context.Context) (context.Context, context.CancelFunc)

func (*BaseRuntime) PodBindVolumeDir

func (r *BaseRuntime) PodBindVolumeDir(podUID, volumeName string) string

func (*BaseRuntime) PodDir

func (r *BaseRuntime) PodDir(podUID string) string

func (*BaseRuntime) PodRemoteVolumeDir

func (r *BaseRuntime) PodRemoteVolumeDir(podUID, volumeName string) string

func (*BaseRuntime) PodResolvConfFile

func (r *BaseRuntime) PodResolvConfFile(podUID string) string

func (*BaseRuntime) PodTmpfsVolumeDir

func (r *BaseRuntime) PodTmpfsVolumeDir(podUID, volumeName string) string

func (*BaseRuntime) Version

func (r *BaseRuntime) Version() string

Jump to

Keyboard shortcuts

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