util

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2014 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActiveToSingleStates added in v0.8.0

func ActiveToSingleStates(active map[string][]UnitState) (map[string]UnitState, error)

ActiveToSingleStates takes a map of active states (such as that returned by WaitForNActiveUnits) and ensures that each unit has at most a single active state. It returns a mapping of unit name to a single UnitState.

func RunFleetctl

func RunFleetctl(args ...string) (string, string, error)

func RunFleetctlWithInput

func RunFleetctlWithInput(input string, args ...string) (string, string, error)

func TempUnit

func TempUnit(contents string) (string, error)

tempUnit creates a local unit file with the given contents, returning the name of the file

func WaitForNActiveUnits

func WaitForNActiveUnits(fleetctl fleetfunc, count int) (map[string][]UnitState, error)

WaitForNActiveUnits polls fleet for up to 15s, exiting when N units are found to be in an active state. It returns a map of unit name to a list of active UnitStates for that unit

func WaitForNMachines

func WaitForNMachines(fleetctl fleetfunc, count int) ([]string, error)

Wait up to 10s to find the specified number of machines, retrying periodically.

Types

type UnitState

type UnitState struct {
	Name        string
	ActiveState string
	Machine     string
}

Jump to

Keyboard shortcuts

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