package global
import "github.com/moby/swarmkit/v2/manager/orchestrator/jobs/global"
Index ¶
- type Reconciler
- func NewReconciler(store *store.MemoryStore, restart restartSupervisor) *Reconciler
- func (r *Reconciler) FixTask(ctx context.Context, batch *store.Batch, t *api.Task)
- func (r *Reconciler) IsRelatedService(service *api.Service) bool
- func (r *Reconciler) ReconcileService(id string) error
- func (r *Reconciler) SlotTuple(t *api.Task) orchestrator.SlotTuple
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.
Source Files ¶
- Version
- v2.1.1 (latest)
- Published
- Oct 7, 2025
- Platform
- linux/amd64
- Imports
- 5 packages
- Last checked
- 4 months ago –
Tools for package owners.