mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 23:37:01 +00:00
kubelet/api: extract PodSandboxManager interface
Splits `RuntimeService` interface into smaller interfaces to make testing easier and to delineate responsibilities.
This commit is contained in:
parent
f715aa475c
commit
f031f09efc
@ -47,12 +47,9 @@ type ContainerManager interface {
|
||||
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
|
||||
|
||||
// PodSandboxManager contains methods for operating on PodSandboxes. The methods
|
||||
// are thread-safe.
|
||||
type PodSandboxManager interface {
|
||||
// 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)
|
||||
@ -68,6 +65,14 @@ type RuntimeService interface {
|
||||
ListPodSandbox(filter *runtimeApi.PodSandboxFilter) ([]*runtimeApi.PodSandbox, error)
|
||||
}
|
||||
|
||||
// RuntimeService interface should be implemented by a container runtime.
|
||||
// The methods should be thread-safe.
|
||||
type RuntimeService interface {
|
||||
RuntimeVersioner
|
||||
ContainerManager
|
||||
PodSandboxManager
|
||||
}
|
||||
|
||||
// ImageManagerService interface should be implemented by a container image
|
||||
// manager.
|
||||
// The methods should be thread-safe.
|
||||
|
Loading…
Reference in New Issue
Block a user