orchestrator

package
v0.0.0-...-120fae7 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultRestartDelay = 5 * time.Second

DefaultRestartDelay is the restart delay value to use when none is specified.

Variables

This section is empty.

Functions

func DeleteServiceTasks

func DeleteServiceTasks(ctx context.Context, s *store.MemoryStore, service *api.Service)

DeleteServiceTasks deletes the tasks associated with a service.

func GetRunnableAndDeadSlots

func GetRunnableAndDeadSlots(s *store.MemoryStore, serviceID string) (map[uint64]Slot, map[uint64]Slot, error)

GetRunnableAndDeadSlots returns two maps of slots. The first contains slots that have at least one task with a desired state above NEW and lesser or equal to RUNNING. The second is for slots that only contain tasks with a desired state above RUNNING.

func InvalidNode

func InvalidNode(n *api.Node) bool

InvalidNode is true if the node is nil, down, or drained

func IsGlobalService

func IsGlobalService(service *api.Service) bool

IsGlobalService checks if the service is a global service.

func IsReplicatedService

func IsReplicatedService(service *api.Service) bool

IsReplicatedService checks if a service is a replicated service.

func IsTaskDirty

func IsTaskDirty(s *api.Service, t *api.Task) bool

IsTaskDirty determines whether a task matches the given service's spec.

func NewTask

func NewTask(cluster *api.Cluster, service *api.Service, slot uint64, nodeID string) *api.Task

NewTask creates a new task.

func RestartCondition

func RestartCondition(task *api.Task) api.RestartPolicy_RestartCondition

RestartCondition returns the restart condition to apply to this task.

Types

type Slot

type Slot []*api.Task

Slot is a list of the running tasks occupying a certain slot. Generally this will only be one task, but some rolling update situations involve temporarily having two running tasks in the same slot. Note that this use of "slot" is more generic than the Slot number for replicated services - a node is also considered a slot for global services.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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