Documentation ¶
Index ¶
- Variables
- func BuildContainerName(metadata *runtimeapi.ContainerMetadata, sandboxID string) string
- func BuildSandboxName(metadata *runtimeapi.PodSandboxMetadata) string
- type FakeContainer
- type FakeImageService
- func (r *FakeImageService) AssertImagePulledWithAuth(t *testing.T, image *runtimeapi.ImageSpec, auth *runtimeapi.AuthConfig, ...)
- func (r *FakeImageService) ImageFsInfo() ([]*runtimeapi.FilesystemUsage, error)
- func (r *FakeImageService) ImageStatus(image *runtimeapi.ImageSpec) (*runtimeapi.Image, error)
- func (r *FakeImageService) ListImages(filter *runtimeapi.ImageFilter) ([]*runtimeapi.Image, error)
- func (r *FakeImageService) PullImage(image *runtimeapi.ImageSpec, auth *runtimeapi.AuthConfig) (string, error)
- func (r *FakeImageService) RemoveImage(image *runtimeapi.ImageSpec) error
- func (r *FakeImageService) SetFakeFilesystemUsage(usage []*runtimeapi.FilesystemUsage)
- func (r *FakeImageService) SetFakeImageSize(size uint64)
- func (r *FakeImageService) SetFakeImages(images []string)
- type FakePodSandbox
- type FakeRuntimeService
- func (r *FakeRuntimeService) AssertCalls(calls []string) error
- func (r *FakeRuntimeService) Attach(req *runtimeapi.AttachRequest) (*runtimeapi.AttachResponse, error)
- func (r *FakeRuntimeService) ContainerStats(containerID string) (*runtimeapi.ContainerStats, error)
- func (r *FakeRuntimeService) ContainerStatus(containerID string) (*runtimeapi.ContainerStatus, error)
- func (r *FakeRuntimeService) CreateContainer(podSandboxID string, config *runtimeapi.ContainerConfig, ...) (string, error)
- func (r *FakeRuntimeService) Exec(*runtimeapi.ExecRequest) (*runtimeapi.ExecResponse, error)
- func (r *FakeRuntimeService) ExecSync(containerID string, cmd []string, timeout time.Duration) (stdout []byte, stderr []byte, err error)
- func (r *FakeRuntimeService) GetContainerID(sandboxID, name string, attempt uint32) (string, error)
- func (r *FakeRuntimeService) InjectError(f string, err error)
- func (r *FakeRuntimeService) ListContainerStats(filter *runtimeapi.ContainerStatsFilter) ([]*runtimeapi.ContainerStats, error)
- func (r *FakeRuntimeService) ListContainers(filter *runtimeapi.ContainerFilter) ([]*runtimeapi.Container, error)
- func (r *FakeRuntimeService) ListPodSandbox(filter *runtimeapi.PodSandboxFilter) ([]*runtimeapi.PodSandbox, error)
- func (r *FakeRuntimeService) PodSandboxStatus(podSandboxID string) (*runtimeapi.PodSandboxStatus, error)
- func (r *FakeRuntimeService) PortForward(*runtimeapi.PortForwardRequest) (*runtimeapi.PortForwardResponse, error)
- func (r *FakeRuntimeService) RemoveContainer(containerID string) error
- func (r *FakeRuntimeService) RemovePodSandbox(podSandboxID string) error
- func (r *FakeRuntimeService) ReopenContainerLog(containerID string) error
- func (r *FakeRuntimeService) RunPodSandbox(config *runtimeapi.PodSandboxConfig, runtimeHandler string) (string, error)
- func (r *FakeRuntimeService) SetFakeContainerStats(containerStats []*runtimeapi.ContainerStats)
- func (r *FakeRuntimeService) SetFakeContainers(containers []*FakeContainer)
- func (r *FakeRuntimeService) SetFakeSandboxes(sandboxes []*FakePodSandbox)
- func (r *FakeRuntimeService) StartContainer(containerID string) error
- func (r *FakeRuntimeService) Status() (*runtimeapi.RuntimeStatus, error)
- func (r *FakeRuntimeService) StopContainer(containerID string, timeout int64) error
- func (r *FakeRuntimeService) StopPodSandbox(podSandboxID string) error
- func (r *FakeRuntimeService) UpdateContainerResources(string, *runtimeapi.LinuxContainerResources) error
- func (r *FakeRuntimeService) UpdateRuntimeConfig(runtimeCOnfig *runtimeapi.RuntimeConfig) error
- func (r *FakeRuntimeService) Version(apiVersion string) (*runtimeapi.VersionResponse, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( FakeVersion = "0.1.0" FakeRuntimeName = "fakeRuntime" FakePodSandboxIP = "192.168.192.168" )
Functions ¶
func BuildContainerName ¶
func BuildContainerName(metadata *runtimeapi.ContainerMetadata, sandboxID string) string
func BuildSandboxName ¶
func BuildSandboxName(metadata *runtimeapi.PodSandboxMetadata) string
Types ¶
type FakeContainer ¶
type FakeContainer struct { // ContainerStatus contains the runtime information for a container. runtimeapi.ContainerStatus // the sandbox id of this container SandboxID string }
type FakeImageService ¶
type FakeImageService struct { sync.Mutex FakeImageSize uint64 Called []string Images map[string]*runtimeapi.Image FakeFilesystemUsage []*runtimeapi.FilesystemUsage // contains filtered or unexported fields }
func NewFakeImageService ¶
func NewFakeImageService() *FakeImageService
func (*FakeImageService) AssertImagePulledWithAuth ¶
func (r *FakeImageService) AssertImagePulledWithAuth(t *testing.T, image *runtimeapi.ImageSpec, auth *runtimeapi.AuthConfig, failMsg string)
func (*FakeImageService) ImageFsInfo ¶
func (r *FakeImageService) ImageFsInfo() ([]*runtimeapi.FilesystemUsage, error)
ImageFsInfo returns information of the filesystem that is used to store images.
func (*FakeImageService) ImageStatus ¶
func (r *FakeImageService) ImageStatus(image *runtimeapi.ImageSpec) (*runtimeapi.Image, error)
func (*FakeImageService) ListImages ¶
func (r *FakeImageService) ListImages(filter *runtimeapi.ImageFilter) ([]*runtimeapi.Image, error)
func (*FakeImageService) PullImage ¶
func (r *FakeImageService) PullImage(image *runtimeapi.ImageSpec, auth *runtimeapi.AuthConfig) (string, error)
func (*FakeImageService) RemoveImage ¶
func (r *FakeImageService) RemoveImage(image *runtimeapi.ImageSpec) error
func (*FakeImageService) SetFakeFilesystemUsage ¶ added in v1.8.8
func (r *FakeImageService) SetFakeFilesystemUsage(usage []*runtimeapi.FilesystemUsage)
func (*FakeImageService) SetFakeImageSize ¶
func (r *FakeImageService) SetFakeImageSize(size uint64)
func (*FakeImageService) SetFakeImages ¶
func (r *FakeImageService) SetFakeImages(images []string)
type FakePodSandbox ¶
type FakePodSandbox struct { // PodSandboxStatus contains the runtime information for a sandbox. runtimeapi.PodSandboxStatus // RuntimeHandler is the runtime handler that was issued with the RunPodSandbox request. RuntimeHandler string }
type FakeRuntimeService ¶
type FakeRuntimeService struct { sync.Mutex Called []string Errors map[string][]error FakeStatus *runtimeapi.RuntimeStatus Containers map[string]*FakeContainer Sandboxes map[string]*FakePodSandbox FakeContainerStats map[string]*runtimeapi.ContainerStats }
func NewFakeRuntimeService ¶
func NewFakeRuntimeService() *FakeRuntimeService
func (*FakeRuntimeService) AssertCalls ¶
func (r *FakeRuntimeService) AssertCalls(calls []string) error
func (*FakeRuntimeService) Attach ¶
func (r *FakeRuntimeService) Attach(req *runtimeapi.AttachRequest) (*runtimeapi.AttachResponse, error)
func (*FakeRuntimeService) ContainerStats ¶
func (r *FakeRuntimeService) ContainerStats(containerID string) (*runtimeapi.ContainerStats, error)
func (*FakeRuntimeService) ContainerStatus ¶
func (r *FakeRuntimeService) ContainerStatus(containerID string) (*runtimeapi.ContainerStatus, error)
func (*FakeRuntimeService) CreateContainer ¶
func (r *FakeRuntimeService) CreateContainer(podSandboxID string, config *runtimeapi.ContainerConfig, sandboxConfig *runtimeapi.PodSandboxConfig) (string, error)
func (*FakeRuntimeService) Exec ¶
func (r *FakeRuntimeService) Exec(*runtimeapi.ExecRequest) (*runtimeapi.ExecResponse, error)
func (*FakeRuntimeService) GetContainerID ¶ added in v1.8.8
func (r *FakeRuntimeService) GetContainerID(sandboxID, name string, attempt uint32) (string, error)
func (*FakeRuntimeService) InjectError ¶ added in v1.10.8
func (r *FakeRuntimeService) InjectError(f string, err error)
func (*FakeRuntimeService) ListContainerStats ¶
func (r *FakeRuntimeService) ListContainerStats(filter *runtimeapi.ContainerStatsFilter) ([]*runtimeapi.ContainerStats, error)
func (*FakeRuntimeService) ListContainers ¶
func (r *FakeRuntimeService) ListContainers(filter *runtimeapi.ContainerFilter) ([]*runtimeapi.Container, error)
func (*FakeRuntimeService) ListPodSandbox ¶
func (r *FakeRuntimeService) ListPodSandbox(filter *runtimeapi.PodSandboxFilter) ([]*runtimeapi.PodSandbox, error)
func (*FakeRuntimeService) PodSandboxStatus ¶
func (r *FakeRuntimeService) PodSandboxStatus(podSandboxID string) (*runtimeapi.PodSandboxStatus, error)
func (*FakeRuntimeService) PortForward ¶
func (r *FakeRuntimeService) PortForward(*runtimeapi.PortForwardRequest) (*runtimeapi.PortForwardResponse, error)
func (*FakeRuntimeService) RemoveContainer ¶
func (r *FakeRuntimeService) RemoveContainer(containerID string) error
func (*FakeRuntimeService) RemovePodSandbox ¶
func (r *FakeRuntimeService) RemovePodSandbox(podSandboxID string) error
func (*FakeRuntimeService) ReopenContainerLog ¶ added in v1.10.8
func (r *FakeRuntimeService) ReopenContainerLog(containerID string) error
func (*FakeRuntimeService) RunPodSandbox ¶
func (r *FakeRuntimeService) RunPodSandbox(config *runtimeapi.PodSandboxConfig, runtimeHandler string) (string, error)
func (*FakeRuntimeService) SetFakeContainerStats ¶ added in v1.8.8
func (r *FakeRuntimeService) SetFakeContainerStats(containerStats []*runtimeapi.ContainerStats)
func (*FakeRuntimeService) SetFakeContainers ¶
func (r *FakeRuntimeService) SetFakeContainers(containers []*FakeContainer)
func (*FakeRuntimeService) SetFakeSandboxes ¶
func (r *FakeRuntimeService) SetFakeSandboxes(sandboxes []*FakePodSandbox)
func (*FakeRuntimeService) StartContainer ¶
func (r *FakeRuntimeService) StartContainer(containerID string) error
func (*FakeRuntimeService) Status ¶
func (r *FakeRuntimeService) Status() (*runtimeapi.RuntimeStatus, error)
func (*FakeRuntimeService) StopContainer ¶
func (r *FakeRuntimeService) StopContainer(containerID string, timeout int64) error
func (*FakeRuntimeService) StopPodSandbox ¶
func (r *FakeRuntimeService) StopPodSandbox(podSandboxID string) error
func (*FakeRuntimeService) UpdateContainerResources ¶ added in v1.8.8
func (r *FakeRuntimeService) UpdateContainerResources(string, *runtimeapi.LinuxContainerResources) error
func (*FakeRuntimeService) UpdateRuntimeConfig ¶
func (r *FakeRuntimeService) UpdateRuntimeConfig(runtimeCOnfig *runtimeapi.RuntimeConfig) error
func (*FakeRuntimeService) Version ¶
func (r *FakeRuntimeService) Version(apiVersion string) (*runtimeapi.VersionResponse, error)
Click to show internal directories.
Click to hide internal directories.