Documentation
¶
Overview ¶
generated by go-extpoints -- DO NOT EDIT
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ComposePlugins = &composePluginExt{ newExtensionPoint(new(ComposePlugin)), }
View Source
var Monitors = &monitorExt{ newExtensionPoint(new(Monitor)), }
View Source
var PodStatusHooks = &podStatusHookExt{ newExtensionPoint(new(PodStatusHook)), }
Functions ¶
func RegisterExtension ¶
func UnregisterExtension ¶
Types ¶
type ComposePlugin ¶
type ComposePlugin interface {
// Name gets the name of the plugin
Name() string
// execute some tasks before the Image is pulled
LaunchTaskPreImagePull(ctx context.Context, composeFiles *[]string, executorId string, taskInfo *mesos.TaskInfo) error
// execute some tasks after the Image is pulled
LaunchTaskPostImagePull(ctx context.Context, composeFiles *[]string, executorId string, taskInfo *mesos.TaskInfo) error
// execute the tasks after the pod is launched
PostLaunchTask(ctx context.Context, composeFiles []string, taskInfo *mesos.TaskInfo) (string, error)
// execute the task before we send a Kill to Mesos
PreKillTask(ctx context.Context, taskInfo *mesos.TaskInfo) error
// execute the task after we send a Kill to Mesos
PostKillTask(ctx context.Context, taskInfo *mesos.TaskInfo) error
// execute the task to shutdown the pod
Shutdown(taskInfo *mesos.TaskInfo, ed executor.ExecutorDriver) error
}
func GetOrderedExtpoints ¶
func GetOrderedExtpoints(plugins []string) []ComposePlugin
type Monitor ¶
Monitor inspects pods periodically until pod failed or terminated It also defines when to consider a pod as failed. Move monitor as a plugin provides flexibility to replace default monitor logic. Monitor name presents in config `monitorName` will be used, otherwise, default monitor will be used.
type PodStatusHook ¶
type PodStatusHook interface {
// TaskInfoInitializer is invoked to initialize the hook with TaskInfo
TaskInfoInitializer(ctx context.Context, data interface{}) error
// Execute is invoked when the pod.taskStatusCh channel has a new status. It returns an error on failure,
// and also a flag "failExec" indicating if the error needs to fail the execution when a series of hooks are executed
// This is to support cases where a few hooks can be executed in a best effort manner and need not fail the executor
Execute(ctx context.Context, podStatus string, data interface{}) (failExec bool, err error)
// This will be called from the pod.stopDriver. This will be used to end anything which needs clean-up at the end
// of the executor
Shutdown(ctx context.Context, podStatus string, data interface{})
}
PodStatusHook allows custom implementations to be plugged when a Pod (mesos task) status changes. Currently this is designed to be executed on task status changes during LaunchTask.
Click to show internal directories.
Click to hide internal directories.