Documentation ¶
Index ¶
- func GenerateEndpoint() (string, error)
- type RemoteRuntime
- func (f *RemoteRuntime) Attach(_ context.Context, req *kubeapi.AttachRequest) (*kubeapi.AttachResponse, error)
- func (f *RemoteRuntime) CheckpointContainer(_ context.Context, _ *kubeapi.CheckpointContainerRequest) (*kubeapi.CheckpointContainerResponse, error)
- func (f *RemoteRuntime) ContainerStats(_ context.Context, req *kubeapi.ContainerStatsRequest) (*kubeapi.ContainerStatsResponse, error)
- func (f *RemoteRuntime) ContainerStatus(_ context.Context, req *kubeapi.ContainerStatusRequest) (*kubeapi.ContainerStatusResponse, error)
- func (f *RemoteRuntime) CreateContainer(_ context.Context, req *kubeapi.CreateContainerRequest) (*kubeapi.CreateContainerResponse, error)
- func (f *RemoteRuntime) Exec(_ context.Context, req *kubeapi.ExecRequest) (*kubeapi.ExecResponse, error)
- func (f *RemoteRuntime) ExecSync(_ context.Context, req *kubeapi.ExecSyncRequest) (*kubeapi.ExecSyncResponse, error)
- func (f *RemoteRuntime) GetContainerEvents(_ *kubeapi.GetEventsRequest, _ kubeapi.RuntimeService_GetContainerEventsServer) error
- func (f *RemoteRuntime) ImageFsInfo(_ context.Context, _ *kubeapi.ImageFsInfoRequest) (*kubeapi.ImageFsInfoResponse, error)
- func (f *RemoteRuntime) ImageStatus(_ context.Context, req *kubeapi.ImageStatusRequest) (*kubeapi.ImageStatusResponse, error)
- func (f *RemoteRuntime) ListContainerStats(_ context.Context, req *kubeapi.ListContainerStatsRequest) (*kubeapi.ListContainerStatsResponse, error)
- func (f *RemoteRuntime) ListContainers(_ context.Context, req *kubeapi.ListContainersRequest) (*kubeapi.ListContainersResponse, error)
- func (f *RemoteRuntime) ListImages(_ context.Context, req *kubeapi.ListImagesRequest) (*kubeapi.ListImagesResponse, error)
- func (f *RemoteRuntime) ListPodSandbox(_ context.Context, req *kubeapi.ListPodSandboxRequest) (*kubeapi.ListPodSandboxResponse, error)
- func (f *RemoteRuntime) ListPodSandboxStats(_ context.Context, req *kubeapi.ListPodSandboxStatsRequest) (*kubeapi.ListPodSandboxStatsResponse, error)
- func (f *RemoteRuntime) PodSandboxStats(_ context.Context, req *kubeapi.PodSandboxStatsRequest) (*kubeapi.PodSandboxStatsResponse, error)
- func (f *RemoteRuntime) PodSandboxStatus(_ context.Context, req *kubeapi.PodSandboxStatusRequest) (*kubeapi.PodSandboxStatusResponse, error)
- func (f *RemoteRuntime) PortForward(_ context.Context, req *kubeapi.PortForwardRequest) (*kubeapi.PortForwardResponse, error)
- func (f *RemoteRuntime) PullImage(_ context.Context, req *kubeapi.PullImageRequest) (*kubeapi.PullImageResponse, error)
- func (f *RemoteRuntime) RemoveContainer(_ context.Context, req *kubeapi.RemoveContainerRequest) (*kubeapi.RemoveContainerResponse, error)
- func (f *RemoteRuntime) RemoveImage(_ context.Context, req *kubeapi.RemoveImageRequest) (*kubeapi.RemoveImageResponse, error)
- func (f *RemoteRuntime) RemovePodSandbox(_ context.Context, req *kubeapi.RemovePodSandboxRequest) (*kubeapi.RemovePodSandboxResponse, error)
- func (f *RemoteRuntime) ReopenContainerLog(_ context.Context, req *kubeapi.ReopenContainerLogRequest) (*kubeapi.ReopenContainerLogResponse, error)
- func (f *RemoteRuntime) RunPodSandbox(_ context.Context, req *kubeapi.RunPodSandboxRequest) (*kubeapi.RunPodSandboxResponse, error)
- func (f *RemoteRuntime) Start(endpoint string) error
- func (f *RemoteRuntime) StartContainer(_ context.Context, req *kubeapi.StartContainerRequest) (*kubeapi.StartContainerResponse, error)
- func (f *RemoteRuntime) Status(_ context.Context, _ *kubeapi.StatusRequest) (*kubeapi.StatusResponse, error)
- func (f *RemoteRuntime) Stop()
- func (f *RemoteRuntime) StopContainer(_ context.Context, req *kubeapi.StopContainerRequest) (*kubeapi.StopContainerResponse, error)
- func (f *RemoteRuntime) StopPodSandbox(_ context.Context, req *kubeapi.StopPodSandboxRequest) (*kubeapi.StopPodSandboxResponse, error)
- func (f *RemoteRuntime) UpdateContainerResources(_ context.Context, req *kubeapi.UpdateContainerResourcesRequest) (*kubeapi.UpdateContainerResourcesResponse, error)
- func (f *RemoteRuntime) UpdateRuntimeConfig(_ context.Context, req *kubeapi.UpdateRuntimeConfigRequest) (*kubeapi.UpdateRuntimeConfigResponse, error)
- func (f *RemoteRuntime) Version(_ context.Context, req *kubeapi.VersionRequest) (*kubeapi.VersionResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateEndpoint ¶
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 ¶
func (f *RemoteRuntime) Attach(_ context.Context, req *kubeapi.AttachRequest) (*kubeapi.AttachResponse, error)
Attach prepares a streaming endpoint to attach to a running container.
func (*RemoteRuntime) CheckpointContainer ¶
func (f *RemoteRuntime) CheckpointContainer(_ context.Context, _ *kubeapi.CheckpointContainerRequest) (*kubeapi.CheckpointContainerResponse, error)
CheckpointContainer checkpoints the given container.
func (*RemoteRuntime) ContainerStats ¶
func (f *RemoteRuntime) ContainerStats(_ context.Context, req *kubeapi.ContainerStatsRequest) (*kubeapi.ContainerStatsResponse, error)
ContainerStats returns stats of the container. If the container does not exist, the call returns an error.
func (*RemoteRuntime) ContainerStatus ¶
func (f *RemoteRuntime) ContainerStatus(_ context.Context, req *kubeapi.ContainerStatusRequest) (*kubeapi.ContainerStatusResponse, error)
ContainerStatus returns status of the container. If the container is not present, returns an error.
func (*RemoteRuntime) CreateContainer ¶
func (f *RemoteRuntime) CreateContainer(_ context.Context, req *kubeapi.CreateContainerRequest) (*kubeapi.CreateContainerResponse, error)
CreateContainer creates a new container in specified PodSandbox
func (*RemoteRuntime) Exec ¶
func (f *RemoteRuntime) Exec(_ context.Context, req *kubeapi.ExecRequest) (*kubeapi.ExecResponse, error)
Exec prepares a streaming endpoint to execute a command in the container.
func (*RemoteRuntime) ExecSync ¶
func (f *RemoteRuntime) ExecSync(_ context.Context, req *kubeapi.ExecSyncRequest) (*kubeapi.ExecSyncResponse, error)
ExecSync runs a command in a container synchronously.
func (*RemoteRuntime) GetContainerEvents ¶
func (f *RemoteRuntime) GetContainerEvents(_ *kubeapi.GetEventsRequest, _ kubeapi.RuntimeService_GetContainerEventsServer) error
func (*RemoteRuntime) ImageFsInfo ¶
func (f *RemoteRuntime) ImageFsInfo(_ context.Context, _ *kubeapi.ImageFsInfoRequest) (*kubeapi.ImageFsInfoResponse, error)
ImageFsInfo returns information of the filesystem that is used to store images.
func (*RemoteRuntime) ImageStatus ¶
func (f *RemoteRuntime) ImageStatus(_ context.Context, req *kubeapi.ImageStatusRequest) (*kubeapi.ImageStatusResponse, error)
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 ¶
func (f *RemoteRuntime) ListContainerStats(_ context.Context, req *kubeapi.ListContainerStatsRequest) (*kubeapi.ListContainerStatsResponse, error)
ListContainerStats returns stats of all running containers.
func (*RemoteRuntime) ListContainers ¶
func (f *RemoteRuntime) ListContainers(_ context.Context, req *kubeapi.ListContainersRequest) (*kubeapi.ListContainersResponse, error)
ListContainers lists all containers by filters.
func (*RemoteRuntime) ListImages ¶
func (f *RemoteRuntime) ListImages(_ context.Context, req *kubeapi.ListImagesRequest) (*kubeapi.ListImagesResponse, error)
ListImages lists existing images.
func (*RemoteRuntime) ListPodSandbox ¶
func (f *RemoteRuntime) ListPodSandbox(_ context.Context, req *kubeapi.ListPodSandboxRequest) (*kubeapi.ListPodSandboxResponse, error)
ListPodSandbox returns a list of PodSandboxes.
func (*RemoteRuntime) ListPodSandboxStats ¶
func (f *RemoteRuntime) ListPodSandboxStats(_ context.Context, req *kubeapi.ListPodSandboxStatsRequest) (*kubeapi.ListPodSandboxStatsResponse, error)
ListPodSandboxStats returns stats of all running pods.
func (*RemoteRuntime) PodSandboxStats ¶
func (f *RemoteRuntime) PodSandboxStats(_ context.Context, req *kubeapi.PodSandboxStatsRequest) (*kubeapi.PodSandboxStatsResponse, error)
PodSandboxStats returns stats of the pod. If the pod does not exist, the call returns an error.
func (*RemoteRuntime) PodSandboxStatus ¶
func (f *RemoteRuntime) PodSandboxStatus(_ context.Context, req *kubeapi.PodSandboxStatusRequest) (*kubeapi.PodSandboxStatusResponse, error)
PodSandboxStatus returns the status of the PodSandbox. If the PodSandbox is not present, returns an error.
func (*RemoteRuntime) PortForward ¶
func (f *RemoteRuntime) PortForward(_ context.Context, req *kubeapi.PortForwardRequest) (*kubeapi.PortForwardResponse, error)
PortForward prepares a streaming endpoint to forward ports from a PodSandbox.
func (*RemoteRuntime) PullImage ¶
func (f *RemoteRuntime) PullImage(_ context.Context, req *kubeapi.PullImageRequest) (*kubeapi.PullImageResponse, error)
PullImage pulls an image with authentication config.
func (*RemoteRuntime) RemoveContainer ¶
func (f *RemoteRuntime) RemoveContainer(_ context.Context, req *kubeapi.RemoveContainerRequest) (*kubeapi.RemoveContainerResponse, error)
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 ¶
func (f *RemoteRuntime) RemoveImage(_ context.Context, req *kubeapi.RemoveImageRequest) (*kubeapi.RemoveImageResponse, error)
RemoveImage removes the image. This call is idempotent, and must not return an error if the image has already been removed.
func (*RemoteRuntime) RemovePodSandbox ¶
func (f *RemoteRuntime) RemovePodSandbox(_ context.Context, req *kubeapi.RemovePodSandboxRequest) (*kubeapi.RemovePodSandboxResponse, error)
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 ¶
func (f *RemoteRuntime) ReopenContainerLog(_ context.Context, req *kubeapi.ReopenContainerLogRequest) (*kubeapi.ReopenContainerLogResponse, error)
ReopenContainerLog reopens the container log file.
func (*RemoteRuntime) RunPodSandbox ¶
func (f *RemoteRuntime) RunPodSandbox(_ context.Context, req *kubeapi.RunPodSandboxRequest) (*kubeapi.RunPodSandboxResponse, error)
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 ¶
func (f *RemoteRuntime) StartContainer(_ context.Context, req *kubeapi.StartContainerRequest) (*kubeapi.StartContainerResponse, error)
StartContainer starts the container.
func (*RemoteRuntime) Status ¶
func (f *RemoteRuntime) Status(_ context.Context, _ *kubeapi.StatusRequest) (*kubeapi.StatusResponse, error)
Status returns the status of the runtime.
func (*RemoteRuntime) StopContainer ¶
func (f *RemoteRuntime) StopContainer(_ context.Context, req *kubeapi.StopContainerRequest) (*kubeapi.StopContainerResponse, error)
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 ¶
func (f *RemoteRuntime) StopPodSandbox(_ context.Context, req *kubeapi.StopPodSandboxRequest) (*kubeapi.StopPodSandboxResponse, error)
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 ¶
func (f *RemoteRuntime) UpdateContainerResources(_ context.Context, req *kubeapi.UpdateContainerResourcesRequest) (*kubeapi.UpdateContainerResourcesResponse, error)
UpdateContainerResources updates ContainerConfig of the container.
func (*RemoteRuntime) UpdateRuntimeConfig ¶
func (f *RemoteRuntime) UpdateRuntimeConfig(_ context.Context, req *kubeapi.UpdateRuntimeConfigRequest) (*kubeapi.UpdateRuntimeConfigResponse, error)
UpdateRuntimeConfig updates the runtime configuration based on the given request.
func (*RemoteRuntime) Version ¶
func (f *RemoteRuntime) Version(_ context.Context, req *kubeapi.VersionRequest) (*kubeapi.VersionResponse, error)
Version returns the runtime name, runtime version, and runtime API version.