Versions in this module Expand all Collapse all v1 v1.16.3 Oct 23, 2019 Changes in this version + const MaxContainerTerminationMessageLength + const MaxContainerTerminationMessageLogLength + const MaxContainerTerminationMessageLogLines + const MaxPodTerminationMessageLogLength + var ErrConfigPodSandbox = errors.New("ConfigPodSandboxError") + var ErrContainerNotFound = errors.New("no matching container") + var ErrCrashLoopBackOff = errors.New("CrashLoopBackOff") + var ErrCreatePodSandbox = errors.New("CreatePodSandboxError") + var ErrKillContainer = errors.New("KillContainerError") + var ErrKillPodSandbox = errors.New("KillPodSandboxError") + var ErrRunContainer = errors.New("RunContainerError") + var ErrRunInitContainer = errors.New("RunInitContainerError") + var ErrSetupNetwork = errors.New("SetupNetworkError") + var ErrTeardownNetwork = errors.New("TeardownNetworkError") + var ErrVerifyNonRoot = errors.New("VerifyNonRootError") + var ImplicitContainerPrefix string = "implicitly required container " + func BuildPodFullName(name, namespace string) string + func EnvVarsToMap(envs []EnvVar) map[string]string + func ExpandContainerCommandAndArgs(container *v1.Container, envs []EnvVar) (command []string, args []string) + func ExpandContainerCommandOnlyStatic(containerCommand []string, envs []v1.EnvVar) (command []string) + func ExpandContainerVolumeMounts(mount v1.VolumeMount, envs []EnvVar) (string, error) + func FilterEventRecorder(recorder record.EventRecorder) record.EventRecorder + func FormatPod(pod *Pod) string + func GenerateContainerRef(pod *v1.Pod, container *v1.Container) (*v1.ObjectReference, error) + func GetContainerSpec(pod *v1.Pod, containerName string) *v1.Container + func GetPodFullName(pod *v1.Pod) string + func HandleResizing(resize <-chan remotecommand.TerminalSize, ...) + func HasPrivilegedContainer(pod *v1.Pod) bool + func HashContainer(container *v1.Container) uint64 + func IsHostNetworkPod(pod *v1.Pod) bool + func ParsePodFullName(podFullName string) (string, string, error) + func ShouldContainerBeRestarted(container *v1.Container, pod *v1.Pod, podStatus *PodStatus) bool + func V1EnvVarsToMap(envs []v1.EnvVar) map[string]string + type Annotation struct + Name string + Value string + type Cache interface + Delete func(types.UID) + Get func(types.UID) (*PodStatus, error) + GetNewerThan func(types.UID, time.Time) (*PodStatus, error) + Set func(types.UID, *PodStatus, error, time.Time) + UpdateTime func(time.Time) + func NewCache() Cache + type Container struct + Hash uint64 + ID ContainerID + Image string + ImageID string + Name string + State ContainerState + type ContainerAttacher interface + AttachContainer func(id ContainerID, stdin io.Reader, stdout, stderr io.WriteCloser, tty bool, ...) (err error) + type ContainerCommandRunner interface + RunInContainer func(id ContainerID, cmd []string, timeout time.Duration) ([]byte, error) + type ContainerGC interface + DeleteAllUnusedContainers func() error + GarbageCollect func() error + func NewContainerGC(runtime Runtime, policy ContainerGCPolicy, ...) (ContainerGC, error) + type ContainerGCPolicy struct + MaxContainers int + MaxPerPodContainer int + MinAge time.Duration + type ContainerID struct + ID string + Type string + func BuildContainerID(typ, ID string) ContainerID + func ParseContainerID(containerID string) ContainerID + func (c *ContainerID) IsEmpty() bool + func (c *ContainerID) MarshalJSON() ([]byte, error) + func (c *ContainerID) ParseString(data string) error + func (c *ContainerID) String() string + func (c *ContainerID) UnmarshalJSON(data []byte) error + type ContainerState string + const ContainerStateCreated + const ContainerStateExited + const ContainerStateRunning + const ContainerStateUnknown + func SandboxToContainerState(state runtimeapi.PodSandboxState) ContainerState + type ContainerStatus struct + CreatedAt time.Time + ExitCode int + FinishedAt time.Time + Hash uint64 + ID ContainerID + Image string + ImageID string + Message string + Name string + Reason string + RestartCount int + StartedAt time.Time + State ContainerState + type DeviceInfo struct + PathInContainer string + PathOnHost string + Permissions string + type DockerID string + func (id DockerID) ContainerID() ContainerID + type EnvVar struct + Name string + Value string + type HandlerRunner interface + Run func(containerID ContainerID, pod *v1.Pod, container *v1.Container, ...) (string, error) + type Image struct + ID string + RepoDigests []string + RepoTags []string + Size int64 + type ImageService interface + GetImageRef func(image ImageSpec) (string, error) + ImageStats func() (*ImageStats, error) + ListImages func() ([]Image, error) + PullImage func(image ImageSpec, pullSecrets []v1.Secret, ...) (string, error) + RemoveImage func(image ImageSpec) error + type ImageSpec struct + Image string + type ImageStats struct + TotalStorageBytes uint64 + type Mount struct + ContainerPath string + HostPath string + Name string + Propagation runtimeapi.MountPropagation + ReadOnly bool + SELinuxRelabel bool + type OSInterface interface + Chmod func(path string, perm os.FileMode) error + Chtimes func(path string, atime time.Time, mtime time.Time) error + Create func(path string) (*os.File, error) + Glob func(pattern string) ([]string, error) + Hostname func() (name string, err error) + MkdirAll func(path string, perm os.FileMode) error + Pipe func() (r *os.File, w *os.File, err error) + ReadDir func(dirname string) ([]os.FileInfo, error) + Remove func(path string) error + RemoveAll func(path string) error + Stat func(path string) (os.FileInfo, error) + Symlink func(oldname string, newname string) error + type Option func(Runtime) + type Pod struct + Containers []*Container + ID types.UID + Name string + Namespace string + Sandboxes []*Container + func ConvertPodStatusToRunningPod(runtimeName string, podStatus *PodStatus) Pod + func (p *Pod) FindContainerByID(id ContainerID) *Container + func (p *Pod) FindContainerByName(containerName string) *Container + func (p *Pod) FindSandboxByID(id ContainerID) *Container + func (p *Pod) IsEmpty() bool + func (p *Pod) ToAPIPod() *v1.Pod + type PodPair struct + APIPod *v1.Pod + RunningPod *Pod + type PodStatus struct + ContainerStatuses []*ContainerStatus + ID types.UID + IPs []string + Name string + Namespace string + SandboxStatuses []*runtimeapi.PodSandboxStatus + func (podStatus *PodStatus) FindContainerStatusByName(containerName string) *ContainerStatus + func (podStatus *PodStatus) GetRunningContainerStatuses() []*ContainerStatus + type PodSyncResult struct + SyncError error + SyncResults []*SyncResult + func (p *PodSyncResult) AddPodSyncResult(result PodSyncResult) + func (p *PodSyncResult) AddSyncResult(result ...*SyncResult) + func (p *PodSyncResult) Error() error + func (p *PodSyncResult) Fail(err error) + type Pods []*Pod + func (p Pods) FindPod(podFullName string, podUID types.UID) Pod + func (p Pods) FindPodByFullName(podFullName string) Pod + func (p Pods) FindPodByID(podUID types.UID) Pod + type PortMapping struct + ContainerPort int + HostIP string + HostPort int + Name string + Protocol v1.Protocol + func MakePortMappings(container *v1.Container) (ports []PortMapping) + type RealOS struct + func (RealOS) Chmod(path string, perm os.FileMode) error + func (RealOS) Chtimes(path string, atime time.Time, mtime time.Time) error + func (RealOS) Create(path string) (*os.File, error) + func (RealOS) Glob(pattern string) ([]string, error) + func (RealOS) Hostname() (name string, err error) + func (RealOS) MkdirAll(path string, perm os.FileMode) error + func (RealOS) Pipe() (r *os.File, w *os.File, err error) + func (RealOS) ReadDir(dirname string) ([]os.FileInfo, error) + func (RealOS) Remove(path string) error + func (RealOS) RemoveAll(path string) error + func (RealOS) Stat(path string) (os.FileInfo, error) + func (RealOS) Symlink(oldname string, newname string) error + type RefManager struct + func NewRefManager() *RefManager + func (c *RefManager) ClearRef(id ContainerID) + func (c *RefManager) GetRef(id ContainerID) (ref *v1.ObjectReference, ok bool) + func (c *RefManager) SetRef(id ContainerID, ref *v1.ObjectReference) + type RunContainerOptions struct + Annotations []Annotation + Devices []DeviceInfo + EnableHostUserNamespace bool + Envs []EnvVar + Hostname string + Mounts []Mount + PodContainerDir string + PortMappings []PortMapping + ReadOnly bool + type Runtime interface + APIVersion func() (Version, error) + DeleteContainer func(containerID ContainerID) error + GarbageCollect func(gcPolicy ContainerGCPolicy, allSourcesReady bool, evictNonDeletedPods bool) error + GetContainerLogs func(ctx context.Context, pod *v1.Pod, containerID ContainerID, ...) (err error) + GetPodStatus func(uid types.UID, name, namespace string) (*PodStatus, error) + GetPods func(all bool) ([]*Pod, error) + KillPod func(pod *v1.Pod, runningPod Pod, gracePeriodOverride *int64) error + Status func() (*RuntimeStatus, error) + SyncPod func(pod *v1.Pod, podStatus *PodStatus, pullSecrets []v1.Secret, ...) PodSyncResult + Type func() string + UpdatePodCIDR func(podCIDR string) error + Version func() (Version, error) + type RuntimeCache interface + ForceUpdateIfOlder func(time.Time) error + GetPods func() ([]*Pod, error) + func NewRuntimeCache(getter podsGetter) (RuntimeCache, error) + type RuntimeCondition struct + Message string + Reason string + Status bool + Type RuntimeConditionType + func (c *RuntimeCondition) String() string + type RuntimeConditionType string + const NetworkReady + const RuntimeReady + type RuntimeHelper interface + GeneratePodHostNameAndDomain func(pod *v1.Pod) (hostname string, hostDomain string, err error) + GenerateRunContainerOptions func(pod *v1.Pod, container *v1.Container, podIP string) (contOpts *RunContainerOptions, cleanupAction func(), err error) + GetExtraSupplementalGroupsForPod func(pod *v1.Pod) []int64 + GetPodCgroupParent func(pod *v1.Pod) string + GetPodDNS func(pod *v1.Pod) (dnsConfig *runtimeapi.DNSConfig, err error) + GetPodDir func(podUID types.UID) string + type RuntimeStatus struct + Conditions []RuntimeCondition + func (r *RuntimeStatus) GetRuntimeCondition(t RuntimeConditionType) *RuntimeCondition + func (s *RuntimeStatus) String() string + type SortContainerStatusesByCreationTime []*ContainerStatus + func (s SortContainerStatusesByCreationTime) Len() int + func (s SortContainerStatusesByCreationTime) Less(i, j int) bool + func (s SortContainerStatusesByCreationTime) Swap(i, j int) + type SourcesReadyProvider interface + AllReady func() bool + type StreamingRuntime interface + GetAttach func(id ContainerID, stdin, stdout, stderr, tty bool) (*url.URL, error) + GetExec func(id ContainerID, cmd []string, stdin, stdout, stderr, tty bool) (*url.URL, error) + GetPortForward func(podName, podNamespace string, podUID types.UID, ports []int32) (*url.URL, error) + type SyncAction string + const ConfigPodSandbox + const CreatePodSandbox + const InitContainer + const KillContainer + const KillPodSandbox + const SetupNetwork + const StartContainer + const TeardownNetwork + type SyncResult struct + Action SyncAction + Error error + Message string + Target interface{} + func NewSyncResult(action SyncAction, target interface{}) *SyncResult + func (r *SyncResult) Fail(err error, msg string) + type TestRuntimeCache struct + func NewTestRuntimeCache(getter podsGetter) *TestRuntimeCache + func (r *TestRuntimeCache) ForceUpdateIfOlder(minExpectedCacheTime time.Time) error + func (r *TestRuntimeCache) GetCachedPods() []*Pod + func (r *TestRuntimeCache) GetPods() ([]*Pod, error) + func (r *TestRuntimeCache) UpdateCacheWithLock() error + type Version interface + Compare func(other string) (int, error) + String func() string + type VolumeInfo struct + BlockVolumeMapper volume.BlockVolumeMapper + InnerVolumeSpecName string + Mounter volume.Mounter + ReadOnly bool + SELinuxLabeled bool + type VolumeMap map[string]VolumeInfo