package global

import "github.com/moby/swarmkit/v2/manager/orchestrator/jobs/global"

Index

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

func (r *Reconciler) FixTask(ctx context.Context, batch *store.Batch, t *api.Task)

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:

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

reconciler.go

Version
v2.1.1 (latest)
Published
Oct 7, 2025
Platform
linux/amd64
Imports
5 packages
Last checked
4 months ago

Tools for package owners.