Documentation ¶
Overview ¶
Package node provides utilities to create and update nodes
Index ¶
- func Create(client *client.Client, hostName string, labels map[string]string) (*api.Node, error)
- func CreateOrUpdate(client *client.Client, hostName string, labels map[string]string) (*api.Node, error)
- func IsSlaveAttributeLabel(l string) bool
- func IsUpToDate(n *api.Node, labels map[string]string) bool
- func NewRegistrator(client *client.Client, lookupNode LookupFunc) *clientRegistrator
- func SlaveAttributesToLabels(attrs []*mesos.Attribute) map[string]string
- func Update(client *client.Client, n *api.Node, labels map[string]string) (*api.Node, error)
- type LookupFunc
- type Registrator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateOrUpdate ¶
func CreateOrUpdate(client *client.Client, hostName string, labels map[string]string) (*api.Node, error)
CreateOrUpdate tries to create a node api object or updates an already existing one
func IsSlaveAttributeLabel ¶
IsSlaveAttributeLabel returns true iff the given label is derived from a slave attribute
func IsUpToDate ¶
IsUpToDate returns true iff the node's slave labels match the given attributes labels
func NewRegistrator ¶
func NewRegistrator(client *client.Client, lookupNode LookupFunc) *clientRegistrator
func SlaveAttributesToLabels ¶
SlaveAttributesToLabels converts slave attributes into string key/value labels
Types ¶
type LookupFunc ¶
type Registrator ¶
type Registrator interface { // Register checks whether the node is registered with the given labels. If it // is not, it is created or updated on the apiserver. If an the node was up-to-date, // false is returned. Register(hostName string, labels map[string]string) (bool, error) // Start the registration loop and return immediately. Run(terminate <-chan struct{}) error }
Click to show internal directories.
Click to hide internal directories.