mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 09:49:50 +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
|
Exec(containerID string, cmd []string, tty bool, stdin io.Reader, stdout, stderr io.WriteCloser) error
|
||||||
}
|
}
|
||||||
|
|
||||||
// RuntimeService interface should be implemented by a container runtime.
|
// PodSandboxManager contains methods for operating on PodSandboxes. The methods
|
||||||
// The methods should be thread-safe.
|
// are thread-safe.
|
||||||
type RuntimeService interface {
|
type PodSandboxManager interface {
|
||||||
RuntimeVersioner
|
|
||||||
ContainerManager
|
|
||||||
|
|
||||||
// CreatePodSandbox creates a pod-level sandbox.
|
// CreatePodSandbox creates a pod-level sandbox.
|
||||||
// The definition of PodSandbox is at https://github.com/kubernetes/kubernetes/pull/25899
|
// The definition of PodSandbox is at https://github.com/kubernetes/kubernetes/pull/25899
|
||||||
CreatePodSandbox(config *runtimeApi.PodSandboxConfig) (string, error)
|
CreatePodSandbox(config *runtimeApi.PodSandboxConfig) (string, error)
|
||||||
@ -68,6 +65,14 @@ type RuntimeService interface {
|
|||||||
ListPodSandbox(filter *runtimeApi.PodSandboxFilter) ([]*runtimeApi.PodSandbox, error)
|
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
|
// 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