Documentation ¶
Index ¶
- Constants
- Variables
- type CniManager
- type CniMgr
- type Config
- type CriManager
- func (c *CriManager) Attach(ctx context.Context, r *runtime.AttachRequest) (*runtime.AttachResponse, error)
- func (c *CriManager) ContainerStats(ctx context.Context, r *runtime.ContainerStatsRequest) (*runtime.ContainerStatsResponse, error)
- func (c *CriManager) ContainerStatus(ctx context.Context, r *runtime.ContainerStatusRequest) (*runtime.ContainerStatusResponse, error)
- func (c *CriManager) CreateContainer(ctx context.Context, r *runtime.CreateContainerRequest) (*runtime.CreateContainerResponse, error)
- func (c *CriManager) Exec(ctx context.Context, r *runtime.ExecRequest) (*runtime.ExecResponse, error)
- func (c *CriManager) ExecSync(ctx context.Context, r *runtime.ExecSyncRequest) (*runtime.ExecSyncResponse, error)
- func (c *CriManager) ImageFsInfo(ctx context.Context, r *runtime.ImageFsInfoRequest) (*runtime.ImageFsInfoResponse, error)
- func (c *CriManager) ImageStatus(ctx context.Context, r *runtime.ImageStatusRequest) (*runtime.ImageStatusResponse, error)
- func (c *CriManager) ListContainerStats(ctx context.Context, r *runtime.ListContainerStatsRequest) (*runtime.ListContainerStatsResponse, error)
- func (c *CriManager) ListContainers(ctx context.Context, r *runtime.ListContainersRequest) (*runtime.ListContainersResponse, error)
- func (c *CriManager) ListImages(ctx context.Context, r *runtime.ListImagesRequest) (*runtime.ListImagesResponse, error)
- func (c *CriManager) ListPodSandbox(ctx context.Context, r *runtime.ListPodSandboxRequest) (*runtime.ListPodSandboxResponse, error)
- func (c *CriManager) PodSandboxStatus(ctx context.Context, r *runtime.PodSandboxStatusRequest) (*runtime.PodSandboxStatusResponse, error)
- func (c *CriManager) PortForward(ctx context.Context, r *runtime.PortForwardRequest) (*runtime.PortForwardResponse, error)
- func (c *CriManager) PullImage(ctx context.Context, r *runtime.PullImageRequest) (*runtime.PullImageResponse, error)
- func (c *CriManager) RemoveContainer(ctx context.Context, r *runtime.RemoveContainerRequest) (*runtime.RemoveContainerResponse, error)
- func (c *CriManager) RemoveImage(ctx context.Context, r *runtime.RemoveImageRequest) (*runtime.RemoveImageResponse, error)
- func (c *CriManager) RemovePodSandbox(ctx context.Context, r *runtime.RemovePodSandboxRequest) (*runtime.RemovePodSandboxResponse, error)
- func (c *CriManager) ReopenContainerLog(ctx context.Context, r *runtime.ReopenContainerLogRequest) (*runtime.ReopenContainerLogResponse, error)
- func (c *CriManager) RunPodSandbox(ctx context.Context, r *runtime.RunPodSandboxRequest) (_ *runtime.RunPodSandboxResponse, retErr error)
- func (c *CriManager) StartContainer(ctx context.Context, r *runtime.StartContainerRequest) (*runtime.StartContainerResponse, error)
- func (c *CriManager) Status(ctx context.Context, r *runtime.StatusRequest) (*runtime.StatusResponse, error)
- func (c *CriManager) StopContainer(ctx context.Context, r *runtime.StopContainerRequest) (*runtime.StopContainerResponse, error)
- func (c *CriManager) StopPodSandbox(ctx context.Context, r *runtime.StopPodSandboxRequest) (*runtime.StopPodSandboxResponse, error)
- func (c *CriManager) StreamServerStart() error
- func (c *CriManager) UpdateContainerResources(ctx context.Context, r *runtime.UpdateContainerResourcesRequest) (*runtime.UpdateContainerResourcesResponse, error)
- func (c *CriManager) UpdateRuntimeConfig(ctx context.Context, r *runtime.UpdateRuntimeConfigRequest) (*runtime.UpdateRuntimeConfigResponse, error)
- func (c *CriManager) Version(ctx context.Context, r *runtime.VersionRequest) (*runtime.VersionResponse, error)
- type CriMgr
- type CriWrapper
- func (c *CriWrapper) Attach(ctx context.Context, r *runtime.AttachRequest) (res *runtime.AttachResponse, err error)
- func (c *CriWrapper) ContainerStats(ctx context.Context, r *runtime.ContainerStatsRequest) (res *runtime.ContainerStatsResponse, err error)
- func (c *CriWrapper) ContainerStatus(ctx context.Context, r *runtime.ContainerStatusRequest) (res *runtime.ContainerStatusResponse, err error)
- func (c *CriWrapper) CreateContainer(ctx context.Context, r *runtime.CreateContainerRequest) (res *runtime.CreateContainerResponse, err error)
- func (c *CriWrapper) Exec(ctx context.Context, r *runtime.ExecRequest) (res *runtime.ExecResponse, err error)
- func (c *CriWrapper) ExecSync(ctx context.Context, r *runtime.ExecSyncRequest) (res *runtime.ExecSyncResponse, err error)
- func (c *CriWrapper) ImageFsInfo(ctx context.Context, r *runtime.ImageFsInfoRequest) (res *runtime.ImageFsInfoResponse, err error)
- func (c *CriWrapper) ImageStatus(ctx context.Context, r *runtime.ImageStatusRequest) (res *runtime.ImageStatusResponse, err error)
- func (c *CriWrapper) ListContainerStats(ctx context.Context, r *runtime.ListContainerStatsRequest) (res *runtime.ListContainerStatsResponse, err error)
- func (c *CriWrapper) ListContainers(ctx context.Context, r *runtime.ListContainersRequest) (res *runtime.ListContainersResponse, err error)
- func (c *CriWrapper) ListImages(ctx context.Context, r *runtime.ListImagesRequest) (res *runtime.ListImagesResponse, err error)
- func (c *CriWrapper) ListPodSandbox(ctx context.Context, r *runtime.ListPodSandboxRequest) (res *runtime.ListPodSandboxResponse, err error)
- func (c *CriWrapper) PodSandboxStatus(ctx context.Context, r *runtime.PodSandboxStatusRequest) (res *runtime.PodSandboxStatusResponse, err error)
- func (c *CriWrapper) PortForward(ctx context.Context, r *runtime.PortForwardRequest) (res *runtime.PortForwardResponse, err error)
- func (c *CriWrapper) PullImage(ctx context.Context, r *runtime.PullImageRequest) (res *runtime.PullImageResponse, err error)
- func (c *CriWrapper) RemoveContainer(ctx context.Context, r *runtime.RemoveContainerRequest) (res *runtime.RemoveContainerResponse, err error)
- func (c *CriWrapper) RemoveImage(ctx context.Context, r *runtime.RemoveImageRequest) (res *runtime.RemoveImageResponse, err error)
- func (c *CriWrapper) RemovePodSandbox(ctx context.Context, r *runtime.RemovePodSandboxRequest) (res *runtime.RemovePodSandboxResponse, err error)
- func (c *CriWrapper) ReopenContainerLog(ctx context.Context, r *runtime.ReopenContainerLogRequest) (res *runtime.ReopenContainerLogResponse, err error)
- func (c *CriWrapper) RunPodSandbox(ctx context.Context, r *runtime.RunPodSandboxRequest) (res *runtime.RunPodSandboxResponse, err error)
- func (c *CriWrapper) StartContainer(ctx context.Context, r *runtime.StartContainerRequest) (res *runtime.StartContainerResponse, err error)
- func (c *CriWrapper) Status(ctx context.Context, r *runtime.StatusRequest) (res *runtime.StatusResponse, err error)
- func (c *CriWrapper) StopContainer(ctx context.Context, r *runtime.StopContainerRequest) (res *runtime.StopContainerResponse, err error)
- func (c *CriWrapper) StopPodSandbox(ctx context.Context, r *runtime.StopPodSandboxRequest) (res *runtime.StopPodSandboxResponse, err error)
- func (c *CriWrapper) StreamServerStart() (err error)
- func (c *CriWrapper) UpdateContainerResources(ctx context.Context, r *runtime.UpdateContainerResourcesRequest) (res *runtime.UpdateContainerResourcesResponse, err error)
- func (c *CriWrapper) UpdateRuntimeConfig(ctx context.Context, r *runtime.UpdateRuntimeConfigRequest) (res *runtime.UpdateRuntimeConfigResponse, err error)
- func (c *CriWrapper) Version(ctx context.Context, r *runtime.VersionRequest) (res *runtime.VersionResponse, err error)
- type NoopCniManager
- func (n *NoopCniManager) GetPodNetworkStatus(netnsPath string) (string, error)
- func (n *NoopCniManager) Name() string
- func (n *NoopCniManager) SetUpPodNetwork(podNetwork *ocicni.PodNetwork) error
- func (n *NoopCniManager) Status() error
- func (n *NoopCniManager) TearDownPodNetwork(podNetwork *ocicni.PodNetwork) error
- type Runtime
- type SandboxMeta
- type Server
Constants ¶
const ( // DefaultStreamIdleTimeout is the timeout for idle stream. DefaultStreamIdleTimeout = 4 * time.Hour // DefaultStreamCreationTimeout is the timeout for stream creation. DefaultStreamCreationTimeout = 30 * time.Second )
Keep these constants consistent with the peers in official package: k8s.io/kubernetes/pkg/kubelet/server.
Variables ¶
var DefaultConfig = Config{ StreamIdleTimeout: 4 * time.Hour, StreamCreationTimeout: DefaultStreamCreationTimeout, SupportedRemoteCommandProtocols: SupportedStreamingProtocols, SupportedPortForwardProtocols: SupportedPortForwardProtocols, }
DefaultConfig provides default values for server Config.
var SupportedPortForwardProtocols = []string{constant.PortForwardProtocolV1Name}
SupportedPortForwardProtocols is the portforward protocols which server supports.
var SupportedStreamingProtocols = []string{constant.StreamProtocolV1Name, constant.StreamProtocolV2Name}
SupportedStreamingProtocols is the streaming protocols which server supports.
Functions ¶
This section is empty.
Types ¶
type CniManager ¶
type CniManager struct {
// contains filtered or unexported fields
}
CniManager is an implementation of interface CniMgr.
func (*CniManager) GetPodNetworkStatus ¶
func (c *CniManager) GetPodNetworkStatus(netnsPath string) (string, error)
GetPodNetworkStatus is the method called to obtain the ipv4 or ipv6 addresses of the pod sandbox.
func (*CniManager) Name ¶
func (c *CniManager) Name() string
Name returns the plugin's name. This will be used when searching for a plugin by name, e.g.
func (*CniManager) SetUpPodNetwork ¶
func (c *CniManager) SetUpPodNetwork(podNetwork *ocicni.PodNetwork) error
SetUpPodNetwork is the method called after the sandbox container of the pod has been created but before the other containers of the pod are launched.
func (*CniManager) Status ¶
func (c *CniManager) Status() error
Status returns error if the network plugin is in error state.
func (*CniManager) TearDownPodNetwork ¶
func (c *CniManager) TearDownPodNetwork(podNetwork *ocicni.PodNetwork) error
TearDownPodNetwork is the method called before a pod's sandbox container will be deleted.
type CniMgr ¶
type CniMgr interface { // Name returns the plugin's name. This will be used when searching // for a plugin by name, e.g. Name() string // SetUpPodNetwork is the method called after the sandbox container of the // pod has been created but before the other containers of the pod // are launched. SetUpPodNetwork(podNetwork *ocicni.PodNetwork) error // TearDownPodNetwork is the method called before a pod's sandbox container will be deleted. TearDownPodNetwork(podNetwork *ocicni.PodNetwork) error // GetPodNetworkStatus is the method called to obtain the ipv4 or ipv6 addresses of the pod sandbox. GetPodNetworkStatus(netnsPath string) (string, error) // Status returns error if the network plugin is in error state. Status() error }
CniMgr as an interface defines all operations against CNI.
func NewCniManager ¶
NewCniManager initializes a brand new cni manager. If initialize failed, return NoopCniManager, we should not make pouchd creashed because of the failure of cni manager.
type Config ¶
type Config struct { // Address is the addr:port address the server will listen on. Address string // BaseURL is the optional base URL for constructing streaming URLs. If empty, the baseURL will be constructed from the serve address. BaseURL *url.URL // StreamIdleTimeout is how long to leave idle connections open for. StreamIdleTimeout time.Duration // StreamCreationTimeout is how long to wait for clients to create streams. Only used for SPDY streaming. StreamCreationTimeout time.Duration // SupportedStreamingProtocols is the streaming protocols which server supports. SupportedRemoteCommandProtocols []string // SupportedPortForwardProtocol is the portforward protocols which server supports. SupportedPortForwardProtocols []string }
Config defines the options used for running the stream server.
type CriManager ¶
type CriManager struct { ContainerMgr mgr.ContainerMgr ImageMgr mgr.ImageMgr CniMgr CniMgr // StreamServer is the stream server of CRI serves container streaming request. StreamServer Server // SandboxBaseDir is the directory used to store sandbox files like /etc/hosts, /etc/resolv.conf, etc. SandboxBaseDir string // SandboxImage is the image used by sandbox container. SandboxImage string // SandboxStore stores the configuration of sandboxes. SandboxStore *meta.Store }
CriManager is an implementation of interface CriMgr.
func (*CriManager) Attach ¶
func (c *CriManager) Attach(ctx context.Context, r *runtime.AttachRequest) (*runtime.AttachResponse, error)
Attach prepares a streaming endpoint to attach to a running container, and returns the address.
func (*CriManager) ContainerStats ¶
func (c *CriManager) ContainerStats(ctx context.Context, r *runtime.ContainerStatsRequest) (*runtime.ContainerStatsResponse, error)
ContainerStats returns stats of the container. If the container does not exist, the call returns an error.
func (*CriManager) ContainerStatus ¶
func (c *CriManager) ContainerStatus(ctx context.Context, r *runtime.ContainerStatusRequest) (*runtime.ContainerStatusResponse, error)
ContainerStatus inspects the container and returns the status.
func (*CriManager) CreateContainer ¶
func (c *CriManager) CreateContainer(ctx context.Context, r *runtime.CreateContainerRequest) (*runtime.CreateContainerResponse, error)
CreateContainer creates a new container in the given PodSandbox.
func (*CriManager) Exec ¶
func (c *CriManager) Exec(ctx context.Context, r *runtime.ExecRequest) (*runtime.ExecResponse, error)
Exec prepares a streaming endpoint to execute a command in the container, and returns the address.
func (*CriManager) ExecSync ¶
func (c *CriManager) ExecSync(ctx context.Context, r *runtime.ExecSyncRequest) (*runtime.ExecSyncResponse, error)
ExecSync executes a command in the container, and returns the stdout output. If command exits with a non-zero exit code, an error is returned.
func (*CriManager) ImageFsInfo ¶
func (c *CriManager) ImageFsInfo(ctx context.Context, r *runtime.ImageFsInfoRequest) (*runtime.ImageFsInfoResponse, error)
ImageFsInfo returns information of the filesystem that is used to store images.
func (*CriManager) ImageStatus ¶
func (c *CriManager) ImageStatus(ctx context.Context, r *runtime.ImageStatusRequest) (*runtime.ImageStatusResponse, error)
ImageStatus returns the status of the image, returns nil if the image isn't present.
func (*CriManager) ListContainerStats ¶
func (c *CriManager) ListContainerStats(ctx context.Context, r *runtime.ListContainerStatsRequest) (*runtime.ListContainerStatsResponse, error)
ListContainerStats returns stats of all running containers.
func (*CriManager) ListContainers ¶
func (c *CriManager) ListContainers(ctx context.Context, r *runtime.ListContainersRequest) (*runtime.ListContainersResponse, error)
ListContainers lists all containers matching the filter.
func (*CriManager) ListImages ¶
func (c *CriManager) ListImages(ctx context.Context, r *runtime.ListImagesRequest) (*runtime.ListImagesResponse, error)
ListImages lists existing images.
func (*CriManager) ListPodSandbox ¶
func (c *CriManager) ListPodSandbox(ctx context.Context, r *runtime.ListPodSandboxRequest) (*runtime.ListPodSandboxResponse, error)
ListPodSandbox returns a list of Sandbox.
func (*CriManager) PodSandboxStatus ¶
func (c *CriManager) PodSandboxStatus(ctx context.Context, r *runtime.PodSandboxStatusRequest) (*runtime.PodSandboxStatusResponse, error)
PodSandboxStatus returns the status of the PodSandbox.
func (*CriManager) PortForward ¶
func (c *CriManager) PortForward(ctx context.Context, r *runtime.PortForwardRequest) (*runtime.PortForwardResponse, error)
PortForward prepares a streaming endpoint to forward ports from a PodSandbox, and returns the address.
func (*CriManager) PullImage ¶
func (c *CriManager) PullImage(ctx context.Context, r *runtime.PullImageRequest) (*runtime.PullImageResponse, error)
PullImage pulls an image with authentication config.
func (*CriManager) RemoveContainer ¶
func (c *CriManager) RemoveContainer(ctx context.Context, r *runtime.RemoveContainerRequest) (*runtime.RemoveContainerResponse, error)
RemoveContainer removes the container.
func (*CriManager) RemoveImage ¶
func (c *CriManager) RemoveImage(ctx context.Context, r *runtime.RemoveImageRequest) (*runtime.RemoveImageResponse, error)
RemoveImage removes the image.
func (*CriManager) RemovePodSandbox ¶
func (c *CriManager) RemovePodSandbox(ctx context.Context, r *runtime.RemovePodSandboxRequest) (*runtime.RemovePodSandboxResponse, error)
RemovePodSandbox removes the sandbox. If there are running containers in the sandbox, they should be forcibly removed.
func (*CriManager) ReopenContainerLog ¶
func (c *CriManager) ReopenContainerLog(ctx context.Context, r *runtime.ReopenContainerLogRequest) (*runtime.ReopenContainerLogResponse, error)
ReopenContainerLog asks runtime to reopen the stdout/stderr log file for the container. This is often called after the log file has been rotated. If the container is not running, container runtime can choose to either create a new log file and return nil, or return an error. Once it returns error, new container log file MUST NOT be created.
func (*CriManager) RunPodSandbox ¶
func (c *CriManager) RunPodSandbox(ctx context.Context, r *runtime.RunPodSandboxRequest) (_ *runtime.RunPodSandboxResponse, retErr error)
RunPodSandbox creates and starts a pod-level sandbox. Runtimes should ensure the sandbox is in ready state.
func (*CriManager) StartContainer ¶
func (c *CriManager) StartContainer(ctx context.Context, r *runtime.StartContainerRequest) (*runtime.StartContainerResponse, error)
StartContainer starts the container.
func (*CriManager) Status ¶
func (c *CriManager) Status(ctx context.Context, r *runtime.StatusRequest) (*runtime.StatusResponse, error)
Status returns the status of the runtime.
func (*CriManager) StopContainer ¶
func (c *CriManager) StopContainer(ctx context.Context, r *runtime.StopContainerRequest) (*runtime.StopContainerResponse, error)
StopContainer stops a running container with a grace period (i.e., timeout).
func (*CriManager) StopPodSandbox ¶
func (c *CriManager) StopPodSandbox(ctx context.Context, r *runtime.StopPodSandboxRequest) (*runtime.StopPodSandboxResponse, error)
StopPodSandbox stops the sandbox. If there are any running containers in the sandbox, they should be forcibly terminated.
func (*CriManager) StreamServerStart ¶
func (c *CriManager) StreamServerStart() error
StreamServerStart starts the stream server of CRI.
func (*CriManager) UpdateContainerResources ¶
func (c *CriManager) UpdateContainerResources(ctx context.Context, r *runtime.UpdateContainerResourcesRequest) (*runtime.UpdateContainerResourcesResponse, error)
UpdateContainerResources updates ContainerConfig of the container.
func (*CriManager) UpdateRuntimeConfig ¶
func (c *CriManager) UpdateRuntimeConfig(ctx context.Context, r *runtime.UpdateRuntimeConfigRequest) (*runtime.UpdateRuntimeConfigResponse, error)
UpdateRuntimeConfig updates the runtime config. Currently only handles podCIDR updates.
func (*CriManager) Version ¶
func (c *CriManager) Version(ctx context.Context, r *runtime.VersionRequest) (*runtime.VersionResponse, error)
Version returns the runtime name, runtime version and runtime API version.
type CriMgr ¶
type CriMgr interface { // RuntimeServiceServer is interface of CRI runtime service. runtime.RuntimeServiceServer // ImageServiceServer is interface of CRI image service. runtime.ImageServiceServer // StreamServerStart starts the stream server of CRI. StreamServerStart() error }
CriMgr as an interface defines all operations against CRI.
func NewCriManager ¶
func NewCriManager(config *config.Config, ctrMgr mgr.ContainerMgr, imgMgr mgr.ImageMgr) (CriMgr, error)
NewCriManager creates a brand new cri manager.
type CriWrapper ¶
type CriWrapper struct {
*CriManager
}
CriWrapper wraps CriManager and logs each operation for debugging convenice.
func NewCriWrapper ¶
func NewCriWrapper(c *CriManager) *CriWrapper
NewCriWrapper creates a brand new CriWrapper.
func (*CriWrapper) Attach ¶
func (c *CriWrapper) Attach(ctx context.Context, r *runtime.AttachRequest) (res *runtime.AttachResponse, err error)
Attach prepares a streaming endpoint to attach to a running container, and returns the address.
func (*CriWrapper) ContainerStats ¶
func (c *CriWrapper) ContainerStats(ctx context.Context, r *runtime.ContainerStatsRequest) (res *runtime.ContainerStatsResponse, err error)
ContainerStats returns stats of the container. If the container does not exist, the call returns an error.
func (*CriWrapper) ContainerStatus ¶
func (c *CriWrapper) ContainerStatus(ctx context.Context, r *runtime.ContainerStatusRequest) (res *runtime.ContainerStatusResponse, err error)
ContainerStatus inspects the container and returns the status.
func (*CriWrapper) CreateContainer ¶
func (c *CriWrapper) CreateContainer(ctx context.Context, r *runtime.CreateContainerRequest) (res *runtime.CreateContainerResponse, err error)
CreateContainer creates a new container in the given PodSandbox.
func (*CriWrapper) Exec ¶
func (c *CriWrapper) Exec(ctx context.Context, r *runtime.ExecRequest) (res *runtime.ExecResponse, err error)
Exec prepares a streaming endpoint to execute a command in the container, and returns the address.
func (*CriWrapper) ExecSync ¶
func (c *CriWrapper) ExecSync(ctx context.Context, r *runtime.ExecSyncRequest) (res *runtime.ExecSyncResponse, err error)
ExecSync executes a command in the container, and returns the stdout output. If command exits with a non-zero exit code, an error is returned.
func (*CriWrapper) ImageFsInfo ¶
func (c *CriWrapper) ImageFsInfo(ctx context.Context, r *runtime.ImageFsInfoRequest) (res *runtime.ImageFsInfoResponse, err error)
ImageFsInfo returns information of the filesystem that is used to store images.
func (*CriWrapper) ImageStatus ¶
func (c *CriWrapper) ImageStatus(ctx context.Context, r *runtime.ImageStatusRequest) (res *runtime.ImageStatusResponse, err error)
ImageStatus returns the status of the image, returns nil if the image isn't present.
func (*CriWrapper) ListContainerStats ¶
func (c *CriWrapper) ListContainerStats(ctx context.Context, r *runtime.ListContainerStatsRequest) (res *runtime.ListContainerStatsResponse, err error)
ListContainerStats returns stats of all running containers.
func (*CriWrapper) ListContainers ¶
func (c *CriWrapper) ListContainers(ctx context.Context, r *runtime.ListContainersRequest) (res *runtime.ListContainersResponse, err error)
ListContainers lists all containers matching the filter.
func (*CriWrapper) ListImages ¶
func (c *CriWrapper) ListImages(ctx context.Context, r *runtime.ListImagesRequest) (res *runtime.ListImagesResponse, err error)
ListImages lists existing images.
func (*CriWrapper) ListPodSandbox ¶
func (c *CriWrapper) ListPodSandbox(ctx context.Context, r *runtime.ListPodSandboxRequest) (res *runtime.ListPodSandboxResponse, err error)
ListPodSandbox returns a list of Sandbox.
func (*CriWrapper) PodSandboxStatus ¶
func (c *CriWrapper) PodSandboxStatus(ctx context.Context, r *runtime.PodSandboxStatusRequest) (res *runtime.PodSandboxStatusResponse, err error)
PodSandboxStatus returns the status of the PodSandbox.
func (*CriWrapper) PortForward ¶
func (c *CriWrapper) PortForward(ctx context.Context, r *runtime.PortForwardRequest) (res *runtime.PortForwardResponse, err error)
PortForward prepares a streaming endpoint to forward ports from a PodSandbox, and returns the address.
func (*CriWrapper) PullImage ¶
func (c *CriWrapper) PullImage(ctx context.Context, r *runtime.PullImageRequest) (res *runtime.PullImageResponse, err error)
PullImage pulls an image with authentication config.
func (*CriWrapper) RemoveContainer ¶
func (c *CriWrapper) RemoveContainer(ctx context.Context, r *runtime.RemoveContainerRequest) (res *runtime.RemoveContainerResponse, err error)
RemoveContainer removes the container.
func (*CriWrapper) RemoveImage ¶
func (c *CriWrapper) RemoveImage(ctx context.Context, r *runtime.RemoveImageRequest) (res *runtime.RemoveImageResponse, err error)
RemoveImage removes the image.
func (*CriWrapper) RemovePodSandbox ¶
func (c *CriWrapper) RemovePodSandbox(ctx context.Context, r *runtime.RemovePodSandboxRequest) (res *runtime.RemovePodSandboxResponse, err error)
RemovePodSandbox removes the sandbox. If there are running containers in the sandbox, they should be forcibly removed.
func (*CriWrapper) ReopenContainerLog ¶
func (c *CriWrapper) ReopenContainerLog(ctx context.Context, r *runtime.ReopenContainerLogRequest) (res *runtime.ReopenContainerLogResponse, err error)
ReopenContainerLog asks runtime to reopen the stdout/stderr log file for the container. This is often called after the log file has been rotated. If the container is not running, container runtime can choose to either create a new log file and return nil, or return an error. Once it returns error, new container log file MUST NOT be created.
func (*CriWrapper) RunPodSandbox ¶
func (c *CriWrapper) RunPodSandbox(ctx context.Context, r *runtime.RunPodSandboxRequest) (res *runtime.RunPodSandboxResponse, err error)
RunPodSandbox creates and starts a pod-level sandbox. Runtimes should ensure the sandbox is in ready state.
func (*CriWrapper) StartContainer ¶
func (c *CriWrapper) StartContainer(ctx context.Context, r *runtime.StartContainerRequest) (res *runtime.StartContainerResponse, err error)
StartContainer starts the container.
func (*CriWrapper) Status ¶
func (c *CriWrapper) Status(ctx context.Context, r *runtime.StatusRequest) (res *runtime.StatusResponse, err error)
Status returns the status of the runtime.
func (*CriWrapper) StopContainer ¶
func (c *CriWrapper) StopContainer(ctx context.Context, r *runtime.StopContainerRequest) (res *runtime.StopContainerResponse, err error)
StopContainer stops a running container with a grace period (i.e., timeout).
func (*CriWrapper) StopPodSandbox ¶
func (c *CriWrapper) StopPodSandbox(ctx context.Context, r *runtime.StopPodSandboxRequest) (res *runtime.StopPodSandboxResponse, err error)
StopPodSandbox stops the sandbox. If there are any running containers in the sandbox, they should be forcibly terminated.
func (*CriWrapper) StreamServerStart ¶
func (c *CriWrapper) StreamServerStart() (err error)
StreamServerStart starts the stream server of CRI.
func (*CriWrapper) UpdateContainerResources ¶
func (c *CriWrapper) UpdateContainerResources(ctx context.Context, r *runtime.UpdateContainerResourcesRequest) (res *runtime.UpdateContainerResourcesResponse, err error)
UpdateContainerResources updates ContainerConfig of the container.
func (*CriWrapper) UpdateRuntimeConfig ¶
func (c *CriWrapper) UpdateRuntimeConfig(ctx context.Context, r *runtime.UpdateRuntimeConfigRequest) (res *runtime.UpdateRuntimeConfigResponse, err error)
UpdateRuntimeConfig updates the runtime config. Currently only handles podCIDR updates.
func (*CriWrapper) Version ¶
func (c *CriWrapper) Version(ctx context.Context, r *runtime.VersionRequest) (res *runtime.VersionResponse, err error)
Version returns the runtime name, runtime version and runtime API version.
type NoopCniManager ¶
type NoopCniManager struct { }
NoopCniManager is an implementation of interface CniMgr, but makes no operation.
func (*NoopCniManager) GetPodNetworkStatus ¶
func (n *NoopCniManager) GetPodNetworkStatus(netnsPath string) (string, error)
GetPodNetworkStatus of NoopCniManager makes no operation.
func (*NoopCniManager) Name ¶
func (n *NoopCniManager) Name() string
Name of NoopCniManager return the name of plugin as "none".
func (*NoopCniManager) SetUpPodNetwork ¶
func (n *NoopCniManager) SetUpPodNetwork(podNetwork *ocicni.PodNetwork) error
SetUpPodNetwork of NoopCniManager makes no operation.
func (*NoopCniManager) Status ¶
func (n *NoopCniManager) Status() error
Status of NoopCniManager makes no operation.
func (*NoopCniManager) TearDownPodNetwork ¶
func (n *NoopCniManager) TearDownPodNetwork(podNetwork *ocicni.PodNetwork) error
TearDownPodNetwork of NoopCniManager makes no operation.
type Runtime ¶
type Runtime interface { // Exec executes the command in pod. Exec(containerID string, cmd []string, streamOpts *remotecommand.Options, streams *remotecommand.Streams) (uint32, error) // Attach attaches to pod. Attach(containerID string, streamOpts *remotecommand.Options, streams *remotecommand.Streams) error // PortForward forward port to pod. PortForward(name string, port int32, stream io.ReadWriteCloser) error }
Runtime is the interface to execute the commands and provide the streams.
type SandboxMeta ¶
type SandboxMeta struct { // ID is the id of sandbox. ID string // Config is CRI sandbox config. Config *runtime.PodSandboxConfig // NetNSPath is the network namespace used by the sandbox. NetNSPath string }
SandboxMeta represents the sandbox's meta data.
type Server ¶
type Server interface { // GetExec get the serving URL for Exec request. GetExec(*runtimeapi.ExecRequest) (*runtimeapi.ExecResponse, error) // GetAttach get the serving URL for Attach request. GetAttach(*runtimeapi.AttachRequest) (*runtimeapi.AttachResponse, error) // GetPortForward get the serving URL for PortForward request. GetPortForward(*runtimeapi.PortForwardRequest) (*runtimeapi.PortForwardResponse, error) // Start starts the stream server. Start() error }
Server as an interface defines all operations against stream server.