Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssignPorts ¶
AssignPorts selects available ports from the offer and returns them.
func ToPluginTasks ¶
ToPluginTasks transforms an array of tasks into an array of placement strategy plugin tasks.
Types ¶
type Offer ¶
type Offer interface { plugins.Host // Returns the ID of the offer (Offer ID or Lease ID) ID() string // Returns the hostname of the offer. Hostname() string // Returns the agent ID that this offer is for. AgentID() string // Returns the available port ranges for this offer. AvailablePortRanges() map[*PortRange]struct{} }
Offer is the interface that represents a Host Offer in v0, or a Host Lease in v1alpha API.
type PortRange ¶
PortRange represents a modifiable closed-open port range [Begin:End[ used when assigning ports to tasks.
func NewPortRange ¶
NewPortRange creates a new modifiable port range from a Mesos value range. Both the begin and end ports are part of the port range.
type Task ¶
type Task interface { plugins.Task // This ID is either the mesos task id or the k8s pod name. OrchestrationID() string // Returns true if the task is past its placement deadline. IsPastDeadline(time.Time) bool // Increments the number of placement rounds that we have // tried to place this task for. IncRounds() // IsPastMaxRounds returns true if the task has been through // too many placement rounds. IsPastMaxRounds() bool // Returns true if the task is ready for host reservation. IsReadyForHostReservation() bool // Returns true if the task should run on revocable resources. IsRevocable() bool // Sets the matching offer for this task. SetPlacement(Offer) // Returns the offer that this tasked was matched with. GetPlacement() Offer // Returns the reason for the placement failure. GetPlacementFailure() string }
Task is the interface that represents a resource manager task. This is meant to wrap around the resource manager protos so we can keep the same logic for v0 and v1alpha API.