Documentation ¶
Index ¶
- Constants
- func ConvertImage(from *storage.ImageResult) *types.Image
- func InitLabel(cLabel string) (string, error)
- func KVMLabel(cLabel string) (string, error)
- func Listen(network, address string) (net.Listener, error)
- type Server
- func (s *Server) Attach(ctx context.Context, req *types.AttachRequest) (*types.AttachResponse, error)
- func (s *Server) CRImportCheckpoint(ctx context.Context, createConfig *types.ContainerConfig, ...) (ctrID string, retErr error)
- func (s *Server) CheckpointContainer(ctx context.Context, req *types.CheckpointContainerRequest) (*types.CheckpointContainerResponse, error)
- func (s *Server) ContainerStats(ctx context.Context, req *types.ContainerStatsRequest) (*types.ContainerStatsResponse, error)
- func (s *Server) ContainerStatus(ctx context.Context, req *types.ContainerStatusRequest) (*types.ContainerStatusResponse, error)
- func (s *Server) CreateContainer(ctx context.Context, req *types.CreateContainerRequest) (res *types.CreateContainerResponse, retErr error)
- func (s *Server) Exec(ctx context.Context, req *types.ExecRequest) (*types.ExecResponse, error)
- func (s *Server) ExecSync(ctx context.Context, req *types.ExecSyncRequest) (*types.ExecSyncResponse, error)
- func (s *Server) FilterDisallowedAnnotations(toFind, toFilter map[string]string, runtimeHandler string) error
- func (s *Server) GetContainerEvents(_ *types.GetEventsRequest, ces types.RuntimeService_GetContainerEventsServer) error
- func (s *Server) GetExtendInterfaceMux(enableProfile bool) *chi.Mux
- func (s *Server) ImageFsInfo(context.Context, *types.ImageFsInfoRequest) (*types.ImageFsInfoResponse, error)
- func (s *Server) ImageStatus(ctx context.Context, req *types.ImageStatusRequest) (*types.ImageStatusResponse, error)
- func (s *Server) ListContainerStats(ctx context.Context, req *types.ListContainerStatsRequest) (*types.ListContainerStatsResponse, error)
- func (s *Server) ListContainers(ctx context.Context, req *types.ListContainersRequest) (*types.ListContainersResponse, error)
- func (s *Server) ListImages(ctx context.Context, req *types.ListImagesRequest) (*types.ListImagesResponse, error)
- func (s *Server) ListMetricDescriptors(ctx context.Context, req *types.ListMetricDescriptorsRequest) (*types.ListMetricDescriptorsResponse, error)
- func (s *Server) ListPodSandbox(ctx context.Context, req *types.ListPodSandboxRequest) (*types.ListPodSandboxResponse, error)
- func (s *Server) ListPodSandboxMetrics(ctx context.Context, req *types.ListPodSandboxMetricsRequest) (*types.ListPodSandboxMetricsResponse, error)
- func (s *Server) ListPodSandboxStats(ctx context.Context, req *types.ListPodSandboxStatsRequest) (*types.ListPodSandboxStatsResponse, error)
- func (s *Server) MonitorsCloseChan() chan struct{}
- func (s *Server) PodSandboxStats(ctx context.Context, req *types.PodSandboxStatsRequest) (*types.PodSandboxStatsResponse, error)
- func (s *Server) PodSandboxStatus(ctx context.Context, req *types.PodSandboxStatusRequest) (*types.PodSandboxStatusResponse, error)
- func (s *Server) PortForward(ctx context.Context, req *types.PortForwardRequest) (*types.PortForwardResponse, error)
- func (s *Server) PullImage(ctx context.Context, req *types.PullImageRequest) (*types.PullImageResponse, error)
- func (s *Server) RemoveContainer(ctx context.Context, req *types.RemoveContainerRequest) (*types.RemoveContainerResponse, error)
- func (s *Server) RemoveImage(ctx context.Context, req *types.RemoveImageRequest) (*types.RemoveImageResponse, error)
- func (s *Server) RemovePodSandbox(ctx context.Context, req *types.RemovePodSandboxRequest) (*types.RemovePodSandboxResponse, error)
- func (s *Server) ReopenContainerLog(ctx context.Context, req *types.ReopenContainerLogRequest) (*types.ReopenContainerLogResponse, error)
- func (s *Server) ReserveSandboxContainerIDAndName(config *types.PodSandboxConfig) (string, error)
- func (s *Server) RunPodSandbox(ctx context.Context, req *types.RunPodSandboxRequest) (*types.RunPodSandboxResponse, error)
- func (s *Server) RuntimeConfig(_ context.Context, req *types.RuntimeConfigRequest) (*types.RuntimeConfigResponse, error)
- func (s *Server) Shutdown(ctx context.Context) error
- func (s *Server) StartContainer(ctx context.Context, req *types.StartContainerRequest) (res *types.StartContainerResponse, retErr error)
- func (s *Server) StartExitMonitor(ctx context.Context)
- func (s *Server) Status(ctx context.Context, req *types.StatusRequest) (*types.StatusResponse, error)
- func (s *Server) StopContainer(ctx context.Context, req *types.StopContainerRequest) (*types.StopContainerResponse, error)
- func (s *Server) StopMonitors()
- func (s *Server) StopPodSandbox(ctx context.Context, req *types.StopPodSandboxRequest) (*types.StopPodSandboxResponse, error)
- func (s *Server) StopStreamServer() error
- func (s *Server) StreamingServerCloseChan() chan struct{}
- func (s *Server) UpdateContainerResources(ctx context.Context, req *types.UpdateContainerResourcesRequest) (*types.UpdateContainerResourcesResponse, error)
- func (s *Server) UpdateRuntimeConfig(ctx context.Context, req *types.UpdateRuntimeConfigRequest) (*types.UpdateRuntimeConfigResponse, error)
- func (s *Server) Version(context.Context, *types.VersionRequest) (*types.VersionResponse, error)
- type StreamService
- func (s StreamService) Attach(ctx context.Context, containerID string, inputStream io.Reader, ...) error
- func (s StreamService) Exec(ctx context.Context, containerID string, cmd []string, stdin io.Reader, ...) error
- func (s StreamService) PortForward(ctx context.Context, podSandboxID string, port int32, ...) error
Constants ¶
const ( InspectConfigEndpoint = "/config" InspectContainersEndpoint = "/containers" InspectInfoEndpoint = "/info" InspectPauseEndpoint = "/pause" InspectUnpauseEndpoint = "/unpause" )
const ( // PodInfraOOMAdj is the value that we set for oom score adj for // the pod infra container. // TODO: Remove this const once this value is provided over CRI // See https://github.com/kubernetes/kubernetes/issues/47938 PodInfraOOMAdj int = -998 PodInfraCPUshares = 2 )
const DefaultUserNSSize = 65536
DefaultUserNSSize is the default size for the user namespace created
Variables ¶
This section is empty.
Functions ¶
func ConvertImage ¶
func ConvertImage(from *storage.ImageResult) *types.Image
ConvertImage takes an containers/storage ImageResult and converts it into a CRI protobuf type. More information about the "why"s of this function can be found in ../cri.md.
Types ¶
type Server ¶
type Server struct { *lib.ContainerServer ContainerEventsChan chan types.ContainerEventResponse // contains filtered or unexported fields }
Server implements the RuntimeService and ImageService
func (*Server) Attach ¶
func (s *Server) Attach(ctx context.Context, req *types.AttachRequest) (*types.AttachResponse, error)
Attach prepares a streaming endpoint to attach to a running container.
func (*Server) CRImportCheckpoint ¶
func (s *Server) CRImportCheckpoint( ctx context.Context, createConfig *types.ContainerConfig, sbID, sandboxUID string, ) (ctrID string, retErr error)
taken from Podman
func (*Server) CheckpointContainer ¶
func (s *Server) CheckpointContainer(ctx context.Context, req *types.CheckpointContainerRequest) (*types.CheckpointContainerResponse, error)
CheckpointContainer checkpoints a container
func (*Server) ContainerStats ¶
func (s *Server) ContainerStats(ctx context.Context, req *types.ContainerStatsRequest) (*types.ContainerStatsResponse, error)
ContainerStats returns stats of the container. If the container does not exist, the call returns an error.
func (*Server) ContainerStatus ¶
func (s *Server) ContainerStatus(ctx context.Context, req *types.ContainerStatusRequest) (*types.ContainerStatusResponse, error)
ContainerStatus returns status of the container.
func (*Server) CreateContainer ¶
func (s *Server) CreateContainer(ctx context.Context, req *types.CreateContainerRequest) (res *types.CreateContainerResponse, retErr error)
CreateContainer creates a new container in specified PodSandbox
func (*Server) Exec ¶
func (s *Server) Exec(ctx context.Context, req *types.ExecRequest) (*types.ExecResponse, error)
Exec prepares a streaming endpoint to execute a command in the container.
func (*Server) ExecSync ¶
func (s *Server) ExecSync(ctx context.Context, req *types.ExecSyncRequest) (*types.ExecSyncResponse, error)
ExecSync runs a command in a container synchronously.
func (*Server) FilterDisallowedAnnotations ¶
func (s *Server) FilterDisallowedAnnotations(toFind, toFilter map[string]string, runtimeHandler string) error
FilterDisallowedAnnotations is a common place to have a map of annotations filtered for both runtimes and workloads. This function exists until the support for runtime level allowed annotations is dropped. toFind is used to find the workload for the specific pod or container, toFilter are the annotations for which disallowed annotations will be filtered. They may be the same. After this function, toFilter will no longer container disallowed annotations.
func (*Server) GetContainerEvents ¶
func (s *Server) GetContainerEvents(_ *types.GetEventsRequest, ces types.RuntimeService_GetContainerEventsServer) error
GetContainerEvents sends the stream of container events to clients
func (*Server) GetExtendInterfaceMux ¶
GetExtendInterfaceMux returns the mux used to serve extend interface requests
func (*Server) ImageFsInfo ¶
func (s *Server) ImageFsInfo(context.Context, *types.ImageFsInfoRequest) (*types.ImageFsInfoResponse, error)
ImageFsInfo returns information of the filesystem that is used to store images.
func (*Server) ImageStatus ¶
func (s *Server) ImageStatus(ctx context.Context, req *types.ImageStatusRequest) (*types.ImageStatusResponse, error)
ImageStatus returns the status of the image.
func (*Server) ListContainerStats ¶
func (s *Server) ListContainerStats(ctx context.Context, req *types.ListContainerStatsRequest) (*types.ListContainerStatsResponse, error)
ListContainerStats returns stats of all running containers.
func (*Server) ListContainers ¶
func (s *Server) ListContainers(ctx context.Context, req *types.ListContainersRequest) (*types.ListContainersResponse, error)
ListContainers lists all containers by filters.
func (*Server) ListImages ¶
func (s *Server) ListImages(ctx context.Context, req *types.ListImagesRequest) (*types.ListImagesResponse, error)
ListImages lists existing images.
func (*Server) ListMetricDescriptors ¶
func (s *Server) ListMetricDescriptors(ctx context.Context, req *types.ListMetricDescriptorsRequest) (*types.ListMetricDescriptorsResponse, error)
ListMetricDescriptors lists all metric descriptors
func (*Server) ListPodSandbox ¶
func (s *Server) ListPodSandbox(ctx context.Context, req *types.ListPodSandboxRequest) (*types.ListPodSandboxResponse, error)
ListPodSandbox returns a list of SandBoxes.
func (*Server) ListPodSandboxMetrics ¶
func (s *Server) ListPodSandboxMetrics(ctx context.Context, req *types.ListPodSandboxMetricsRequest) (*types.ListPodSandboxMetricsResponse, error)
ListPodSandboxMetrics lists all pod sandbox metrics
func (*Server) ListPodSandboxStats ¶
func (s *Server) ListPodSandboxStats(ctx context.Context, req *types.ListPodSandboxStatsRequest) (*types.ListPodSandboxStatsResponse, error)
ListPodSandboxStats returns stats of all sandboxes.
func (*Server) MonitorsCloseChan ¶
func (s *Server) MonitorsCloseChan() chan struct{}
MonitorsCloseChan returns the close chan for the exit monitor
func (*Server) PodSandboxStats ¶
func (s *Server) PodSandboxStats(ctx context.Context, req *types.PodSandboxStatsRequest) (*types.PodSandboxStatsResponse, error)
PodSandboxStats returns stats of the sandbox. If the sandbox does not exist, the call returns an error.
func (*Server) PodSandboxStatus ¶
func (s *Server) PodSandboxStatus(ctx context.Context, req *types.PodSandboxStatusRequest) (*types.PodSandboxStatusResponse, error)
PodSandboxStatus returns the Status of the PodSandbox.
func (*Server) PortForward ¶
func (s *Server) PortForward(ctx context.Context, req *types.PortForwardRequest) (*types.PortForwardResponse, error)
PortForward prepares a streaming endpoint to forward ports from a PodSandbox.
func (*Server) PullImage ¶
func (s *Server) PullImage(ctx context.Context, req *types.PullImageRequest) (*types.PullImageResponse, error)
PullImage pulls a image with authentication config.
func (*Server) RemoveContainer ¶
func (s *Server) RemoveContainer(ctx context.Context, req *types.RemoveContainerRequest) (*types.RemoveContainerResponse, error)
RemoveContainer removes the container. If the container is running, the container should be force removed.
func (*Server) RemoveImage ¶
func (s *Server) RemoveImage(ctx context.Context, req *types.RemoveImageRequest) (*types.RemoveImageResponse, error)
RemoveImage removes the image.
func (*Server) RemovePodSandbox ¶
func (s *Server) RemovePodSandbox(ctx context.Context, req *types.RemovePodSandboxRequest) (*types.RemovePodSandboxResponse, error)
RemovePodSandbox deletes the sandbox. If there are any running containers in the sandbox, they should be force deleted.
func (*Server) ReopenContainerLog ¶
func (s *Server) ReopenContainerLog(ctx context.Context, req *types.ReopenContainerLogRequest) (*types.ReopenContainerLogResponse, error)
ReopenContainerLog reopens the containers log file
func (*Server) ReserveSandboxContainerIDAndName ¶
func (s *Server) ReserveSandboxContainerIDAndName(config *types.PodSandboxConfig) (string, error)
func (*Server) RunPodSandbox ¶
func (s *Server) RunPodSandbox(ctx context.Context, req *types.RunPodSandboxRequest) (*types.RunPodSandboxResponse, error)
RunPodSandbox creates and runs a pod-level sandbox.
func (*Server) RuntimeConfig ¶
func (s *Server) RuntimeConfig(_ context.Context, req *types.RuntimeConfigRequest) (*types.RuntimeConfigResponse, error)
RuntimeConfig returns configuration information of the runtime.
func (*Server) StartContainer ¶
func (s *Server) StartContainer(ctx context.Context, req *types.StartContainerRequest) (res *types.StartContainerResponse, retErr error)
StartContainer starts the container.
func (*Server) StartExitMonitor ¶
StartExitMonitor start a routine that monitors container exits and updates the container status
func (*Server) Status ¶
func (s *Server) Status(ctx context.Context, req *types.StatusRequest) (*types.StatusResponse, error)
Status returns the status of the runtime
func (*Server) StopContainer ¶
func (s *Server) StopContainer(ctx context.Context, req *types.StopContainerRequest) (*types.StopContainerResponse, error)
StopContainer stops a running container with a grace period (i.e., timeout).
func (*Server) StopPodSandbox ¶
func (s *Server) StopPodSandbox(ctx context.Context, req *types.StopPodSandboxRequest) (*types.StopPodSandboxResponse, error)
StopPodSandbox stops the sandbox. If there are any running containers in the sandbox, they should be force terminated.
func (*Server) StopStreamServer ¶
StopStreamServer stops the stream server
func (*Server) StreamingServerCloseChan ¶
func (s *Server) StreamingServerCloseChan() chan struct{}
StreamingServerCloseChan returns the close channel for the streaming server
func (*Server) UpdateContainerResources ¶
func (s *Server) UpdateContainerResources(ctx context.Context, req *types.UpdateContainerResourcesRequest) (*types.UpdateContainerResourcesResponse, error)
UpdateContainerResources updates ContainerConfig of the container.
func (*Server) UpdateRuntimeConfig ¶
func (s *Server) UpdateRuntimeConfig( ctx context.Context, req *types.UpdateRuntimeConfigRequest, ) (*types.UpdateRuntimeConfigResponse, error)
func (*Server) Version ¶
func (s *Server) Version(context.Context, *types.VersionRequest) (*types.VersionResponse, error)
Version returns the runtime name, runtime version and runtime API version
type StreamService ¶
StreamService implements streaming.Runtime.
func (StreamService) Attach ¶
func (s StreamService) Attach(ctx context.Context, containerID string, inputStream io.Reader, outputStream, errorStream io.WriteCloser, tty bool, resizeChan <-chan remotecommand.TerminalSize) error
Attach endpoint for streaming.Runtime
func (StreamService) Exec ¶
func (s StreamService) Exec(ctx context.Context, containerID string, cmd []string, stdin io.Reader, stdout, stderr io.WriteCloser, tty bool, resizeChan <-chan remotecommand.TerminalSize) error
Exec endpoint for streaming.Runtime
func (StreamService) PortForward ¶
func (s StreamService) PortForward(ctx context.Context, podSandboxID string, port int32, stream io.ReadWriteCloser) error
Source Files ¶
- container_attach.go
- container_checkpoint.go
- container_create.go
- container_create_linux.go
- container_events.go
- container_exec.go
- container_execsync.go
- container_list.go
- container_portforward.go
- container_remove.go
- container_remove_linux.go
- container_reopen_log.go
- container_restore.go
- container_start.go
- container_stats.go
- container_stats_list.go
- container_status.go
- container_stop.go
- container_update_resources.go
- image_fs_info.go
- image_list.go
- image_pull.go
- image_remove.go
- image_status.go
- inspect.go
- label_linux.go
- listen_unix.go
- metric_descriptors_list.go
- naming.go
- nri-api.go
- rootless_linux.go
- runtime_config.go
- runtime_status.go
- sandbox_list.go
- sandbox_metrics_list.go
- sandbox_network.go
- sandbox_remove.go
- sandbox_run.go
- sandbox_run_linux.go
- sandbox_stats.go
- sandbox_stats_list.go
- sandbox_status.go
- sandbox_stop.go
- sandbox_stop_linux.go
- selinux.go
- server.go
- server_linux.go
- update_runtime_config.go
- utils.go
- version.go
Directories ¶
Path | Synopsis |
---|---|
Package useragent provides helper functions to pack version information into a single User-Agent header.
|
Package useragent provides helper functions to pack version information into a single User-Agent header. |