mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-11 13:02:14 +00:00
kubelet/api: extract ContainerManager interface
This commit is contained in:
parent
cfc08dea34
commit
f715aa475c
@ -28,24 +28,9 @@ type RuntimeVersioner interface {
|
|||||||
Version(apiVersion string) (*runtimeApi.VersionResponse, error)
|
Version(apiVersion string) (*runtimeApi.VersionResponse, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
// RuntimeService interface should be implemented by a container runtime.
|
// ContainerManager contains methods to manipulate containers managed by a
|
||||||
// The methods should be thread-safe.
|
// container runtime. The methods are thread-safe.
|
||||||
type RuntimeService interface {
|
type ContainerManager interface {
|
||||||
RuntimeVersioner
|
|
||||||
|
|
||||||
// CreatePodSandbox creates a pod-level sandbox.
|
|
||||||
// The definition of PodSandbox is at https://github.com/kubernetes/kubernetes/pull/25899
|
|
||||||
CreatePodSandbox(config *runtimeApi.PodSandboxConfig) (string, error)
|
|
||||||
// StopPodSandbox stops the sandbox. If there are any running containers in the
|
|
||||||
// sandbox, they should be force terminated.
|
|
||||||
StopPodSandbox(podSandboxID string) error
|
|
||||||
// RemovePodSandbox removes the sandbox. If there are running containers in the
|
|
||||||
// sandbox, they should be forcibly removed.
|
|
||||||
RemovePodSandbox(podSandboxID string) error
|
|
||||||
// PodSandboxStatus returns the Status of the PodSandbox.
|
|
||||||
PodSandboxStatus(podSandboxID string) (*runtimeApi.PodSandboxStatus, error)
|
|
||||||
// ListPodSandbox returns a list of Sandbox.
|
|
||||||
ListPodSandbox(filter *runtimeApi.PodSandboxFilter) ([]*runtimeApi.PodSandbox, error)
|
|
||||||
// CreateContainer creates a new container in specified PodSandbox.
|
// CreateContainer creates a new container in specified PodSandbox.
|
||||||
CreateContainer(podSandboxID string, config *runtimeApi.ContainerConfig, sandboxConfig *runtimeApi.PodSandboxConfig) (string, error)
|
CreateContainer(podSandboxID string, config *runtimeApi.ContainerConfig, sandboxConfig *runtimeApi.PodSandboxConfig) (string, error)
|
||||||
// StartContainer starts the container.
|
// StartContainer starts the container.
|
||||||
@ -62,6 +47,27 @@ type RuntimeService interface {
|
|||||||
Exec(containerID string, cmd []string, tty bool, stdin io.Reader, stdout, stderr io.WriteCloser) error
|
Exec(containerID string, cmd []string, tty bool, stdin io.Reader, stdout, stderr io.WriteCloser) error
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RuntimeService interface should be implemented by a container runtime.
|
||||||
|
// The methods should be thread-safe.
|
||||||
|
type RuntimeService interface {
|
||||||
|
RuntimeVersioner
|
||||||
|
ContainerManager
|
||||||
|
|
||||||
|
// CreatePodSandbox creates a pod-level sandbox.
|
||||||
|
// The definition of PodSandbox is at https://github.com/kubernetes/kubernetes/pull/25899
|
||||||
|
CreatePodSandbox(config *runtimeApi.PodSandboxConfig) (string, error)
|
||||||
|
// StopPodSandbox stops the sandbox. If there are any running containers in the
|
||||||
|
// sandbox, they should be force terminated.
|
||||||
|
StopPodSandbox(podSandboxID string) error
|
||||||
|
// RemovePodSandbox removes the sandbox. If there are running containers in the
|
||||||
|
// sandbox, they should be forcibly removed.
|
||||||
|
RemovePodSandbox(podSandboxID string) error
|
||||||
|
// PodSandboxStatus returns the Status of the PodSandbox.
|
||||||
|
PodSandboxStatus(podSandboxID string) (*runtimeApi.PodSandboxStatus, error)
|
||||||
|
// ListPodSandbox returns a list of Sandbox.
|
||||||
|
ListPodSandbox(filter *runtimeApi.PodSandboxFilter) ([]*runtimeApi.PodSandbox, error)
|
||||||
|
}
|
||||||
|
|
||||||
// ImageManagerService interface should be implemented by a container image
|
// ImageManagerService interface should be implemented by a container image
|
||||||
// manager.
|
// manager.
|
||||||
// The methods should be thread-safe.
|
// The methods should be thread-safe.
|
||||||
|
Loading…
Reference in New Issue
Block a user