package update

import "github.com/moby/swarmkit/v2/manager/orchestrator/update"

Index

Types

type Supervisor

type Supervisor struct {
	// contains filtered or unexported fields
}

Supervisor supervises a set of updates. It's responsible for keeping track of updates, shutting them down and replacing them.

func NewSupervisor

func NewSupervisor(store *store.MemoryStore, restartSupervisor *restart.Supervisor) *Supervisor

NewSupervisor creates a new UpdateSupervisor.

func (*Supervisor) CancelAll

func (u *Supervisor) CancelAll()

CancelAll cancels all current updates.

func (*Supervisor) Update

func (u *Supervisor) Update(ctx context.Context, cluster *api.Cluster, service *api.Service, slots []orchestrator.Slot)

Update starts an Update of `slots` belonging to `service` in the background and returns immediately. Each slot contains a group of one or more tasks occupying the same slot (replicated service) or node (global service). There may be more than one task per slot in cases where an update is in progress and the new task was started before the old one was shut down. If an update for that service was already in progress, it will be cancelled before the new one starts.

type Updater

type Updater struct {
	// contains filtered or unexported fields
}

Updater updates a set of tasks to a new version.

func NewUpdater

func NewUpdater(store *store.MemoryStore, restartSupervisor *restart.Supervisor, cluster *api.Cluster, newService *api.Service) *Updater

NewUpdater creates a new Updater.

func (*Updater) Cancel

func (u *Updater) Cancel()

Cancel cancels the current update immediately. It blocks until the cancellation is confirmed.

func (*Updater) Run

func (u *Updater) Run(ctx context.Context, slots []orchestrator.Slot)

Run starts the update and returns only once its complete or cancelled.

Source Files

updater.go

Version
v2.0.0-20250103191802-8c1959736554 (latest)
Published
Jan 3, 2025
Platform
linux/amd64
Imports
17 packages
Last checked
1 week ago

Tools for package owners.