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:
Victor Marmol
2015-04-29 13:35:37 -07:00
parent 5f831666de
commit 61d51243c5
2 changed files with 74 additions and 0 deletions

View File

@@ -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