Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Reconciler ¶
type Reconciler struct {
// contains filtered or unexported fields
}
Reconciler is an object that manages reconciliation of global jobs. It is blocking and non-asynchronous, for ease of testing. It implements the Reconciler interface from the orchestrator package above it, and the taskinit.InitHandler interface.
func NewReconciler ¶
func NewReconciler(store *store.MemoryStore, restart restartSupervisor) *Reconciler
NewReconciler creates a new global job reconciler.
func (*Reconciler) FixTask ¶
FixTask validates that a task is compliant with the rest of the cluster state, and fixes it if it's not. This covers some main scenarios:
- The node that the task is running on is now paused or drained. we do not need to check if the node still meets constraints -- that is the purview of the constraint enforcer.
- The task has failed and needs to be restarted.
This implements the FixTask method of the taskinit.InitHandler interface.
func (*Reconciler) IsRelatedService ¶
func (r *Reconciler) IsRelatedService(service *api.Service) bool
IsRelatedService returns true if the task is a global job. This method fulfills the taskinit.InitHandler interface. Because it is just a wrapper around a well-tested function call, it has no tests of its own.
func (*Reconciler) ReconcileService ¶
func (r *Reconciler) ReconcileService(id string) error
ReconcileService reconciles one global job service.
func (*Reconciler) SlotTuple ¶
func (r *Reconciler) SlotTuple(t *api.Task) orchestrator.SlotTuple
SlotTuple returns a slot tuple representing this task. It implements the taskinit.InitHandler interface.