fake

package
v1.18.6 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package fake containers a fake gRPC implementation of internalapi.RuntimeService and internalapi.ImageManagerService.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateEndpoint

func GenerateEndpoint() (string, error)

GenerateEndpoint generates a new unix socket server of grpc server.

Types

type RemoteRuntime

type RemoteRuntime struct {

	// Fake runtime service.
	RuntimeService *apitest.FakeRuntimeService
	// Fake image service.
	ImageService *apitest.FakeImageService
	// contains filtered or unexported fields
}

RemoteRuntime represents a fake remote container runtime.

func NewFakeRemoteRuntime

func NewFakeRemoteRuntime() *RemoteRuntime

NewFakeRemoteRuntime creates a new RemoteRuntime.

func (*RemoteRuntime) Attach

Attach prepares a streaming endpoint to attach to a running container.

func (*RemoteRuntime) ContainerStats

ContainerStats returns stats of the container. If the container does not exist, the call returns an error.

func (*RemoteRuntime) ContainerStatus

ContainerStatus returns status of the container. If the container is not present, returns an error.

func (*RemoteRuntime) CreateContainer

CreateContainer creates a new container in specified PodSandbox

func (*RemoteRuntime) Exec

Exec prepares a streaming endpoint to execute a command in the container.

func (*RemoteRuntime) ExecSync

ExecSync runs a command in a container synchronously.

func (*RemoteRuntime) ImageFsInfo

ImageFsInfo returns information of the filesystem that is used to store images.

func (*RemoteRuntime) ImageStatus

ImageStatus returns the status of the image. If the image is not present, returns a response with ImageStatusResponse.Image set to nil.

func (*RemoteRuntime) ListContainerStats

ListContainerStats returns stats of all running containers.

func (*RemoteRuntime) ListContainers

ListContainers lists all containers by filters.

func (*RemoteRuntime) ListImages

ListImages lists existing images.

func (*RemoteRuntime) ListPodSandbox

ListPodSandbox returns a list of PodSandboxes.

func (*RemoteRuntime) PodSandboxStatus

PodSandboxStatus returns the status of the PodSandbox. If the PodSandbox is not present, returns an error.

func (*RemoteRuntime) PortForward

PortForward prepares a streaming endpoint to forward ports from a PodSandbox.

func (*RemoteRuntime) PullImage

PullImage pulls an image with authentication config.

func (*RemoteRuntime) RemoveContainer

RemoveContainer removes the container. If the container is running, the container must be forcibly removed. This call is idempotent, and must not return an error if the container has already been removed.

func (*RemoteRuntime) RemoveImage

RemoveImage removes the image. This call is idempotent, and must not return an error if the image has already been removed.

func (*RemoteRuntime) RemovePodSandbox

RemovePodSandbox removes the sandbox. If there are any running containers in the sandbox, they must be forcibly terminated and removed. This call is idempotent, and must not return an error if the sandbox has already been removed.

func (*RemoteRuntime) ReopenContainerLog added in v1.10.0

ReopenContainerLog reopens the container log file.

func (*RemoteRuntime) RunPodSandbox

RunPodSandbox creates and starts a pod-level sandbox. Runtimes must ensure the sandbox is in the ready state on success.

func (*RemoteRuntime) Start

func (f *RemoteRuntime) Start(endpoint string) error

Start starts the fake remote runtime.

func (*RemoteRuntime) StartContainer

StartContainer starts the container.

func (*RemoteRuntime) Status

Status returns the status of the runtime.

func (*RemoteRuntime) Stop

func (f *RemoteRuntime) Stop()

Stop stops the fake remote runtime.

func (*RemoteRuntime) StopContainer

StopContainer stops a running container with a grace period (i.e., timeout). This call is idempotent, and must not return an error if the container has already been stopped.

func (*RemoteRuntime) StopPodSandbox

StopPodSandbox stops any running process that is part of the sandbox and reclaims network resources (e.g., IP addresses) allocated to the sandbox. If there are any running containers in the sandbox, they must be forcibly terminated.

func (*RemoteRuntime) UpdateContainerResources

UpdateContainerResources updates ContainerConfig of the container.

func (*RemoteRuntime) UpdateRuntimeConfig

UpdateRuntimeConfig updates the runtime configuration based on the given request.

func (*RemoteRuntime) Version

Version returns the runtime name, runtime version, and runtime API version.

Jump to

Keyboard shortcuts

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