update

package
v0.0.0-...-6abf9c9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 2, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL