Documentation ¶
Index ¶
- Constants
- func DeleteServiceTasks(ctx context.Context, s *store.MemoryStore, service *api.Service)
- func GetRunnableAndDeadSlots(s *store.MemoryStore, serviceID string) (map[uint64]Slot, map[uint64]Slot, error)
- func InvalidNode(n *api.Node) bool
- func IsGlobalService(service *api.Service) bool
- func IsReplicatedService(service *api.Service) bool
- func IsTaskDirty(s *api.Service, t *api.Task) bool
- func NewTask(cluster *api.Cluster, service *api.Service, slot uint64, nodeID string) *api.Task
- func RestartCondition(task *api.Task) api.RestartPolicy_RestartCondition
- type Slot
Constants ¶
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 ¶
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 ¶
InvalidNode is true if the node is nil, down, or drained
func IsGlobalService ¶
IsGlobalService checks if the service is a global service.
func IsReplicatedService ¶
IsReplicatedService checks if a service is a replicated service.
func IsTaskDirty ¶
IsTaskDirty determines whether a task matches the given service's spec.
func RestartCondition ¶
func RestartCondition(task *api.Task) api.RestartPolicy_RestartCondition
RestartCondition returns the restart condition to apply to this task.
Types ¶
type Slot ¶
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.