mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-15 06:01:50 +00:00
Add RuntimeHooks interface and Kubelet implementation.
This interface will be used to inject functionality and logic into the runtimes that should be shared accross runtimes.
This commit is contained in:
@@ -81,6 +81,16 @@ type Runtime interface {
|
||||
GetContainerLogs(containerID, tail string, follow bool, stdout, stderr io.Writer) (err error)
|
||||
}
|
||||
|
||||
// Customizable hooks injected into container runtimes.
|
||||
type RuntimeHooks interface {
|
||||
// Determines whether the runtime should pull the specified container's image.
|
||||
ShouldPullImage(pod *api.Pod, container *api.Container, imagePresent bool) bool
|
||||
|
||||
// Runs after an image is pulled reporting it's status. Error may be nil
|
||||
// for a successful pull.
|
||||
ReportImagePull(pod *api.Pod, container *api.Container, err error)
|
||||
}
|
||||
|
||||
// Pod is a group of containers, with the status of the pod.
|
||||
type Pod struct {
|
||||
// The ID of the pod, which can be used to retrieve a particular pod
|
||||
|
Reference in New Issue
Block a user