util

package
v0.0.0-...-9d16c16 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CharSet defines the alphanumeric set for random string generation
	CharSet = "0123456789abcdefghijklmnopqrstuvwxyz"
)

Variables

This section is empty.

Functions

func Contains

func Contains(list []string, strToSearch string) bool

Contains returns true if a list contains a string

func Copy

Copy deep copies a Machine object

func ExecCommand

func ExecCommand(name string, args ...string) string

ExecCommand Executes a local command in the current shell

func Filter

func Filter(list []string, strToFilter string) (newList []string)

Filter filters a list for a string

func GetControlPlaneMachine

func GetControlPlaneMachine(machines []*clusterv1.Machine) *clusterv1.Machine

GetControlPlaneMachine returns the control plane machine from a slice

func GetDefaultKubeConfigPath

func GetDefaultKubeConfigPath() string

GetDefaultKubeConfigPath returns the standard user kubeconfig

func GetMachineIfExists

func GetMachineIfExists(c client.Client, namespace, name string) (*clusterv1.Machine, error)

GetMachineIfExists gets a machine from the API server if it exists

func GetNamespaceOrDefault

func GetNamespaceOrDefault(namespace string) string

GetNamespaceOrDefault returns the default namespace if given empty output

func Home

func Home() string

Home returns the user home directory

func IsControlPlaneMachine

func IsControlPlaneMachine(machine *clusterv1.Machine) bool

IsControlPlaneMachine checks machine is a control plane node TODO(robertbailey): Remove this function

func IsNodeReady

func IsNodeReady(node *v1.Node) bool

IsNodeReady returns true if a node is ready

func MachineP

func MachineP(machines []clusterv1.Machine) []*clusterv1.Machine

MachineP converts a slice of machines into a slice of machine pointers

func ParseClusterYaml

func ParseClusterYaml(file string) (*clusterv1.Cluster, error)

ParseClusterYaml parses a YAML file for cluster objects

func ParseMachinesYaml

func ParseMachinesYaml(file string) ([]*clusterv1.Machine, error)

ParseMachinesYaml extracts machine objects from a file

func Poll

func Poll(interval, timeout time.Duration, condition wait.ConditionFunc) error

func PollImmediate

func PollImmediate(interval, timeout time.Duration, condition wait.ConditionFunc) error

func RandomString

func RandomString(n int) string

RandomString returns a random alphanumeric string

func RandomToken

func RandomToken() string

RandomToken returns a random token

func Retry

func Retry(fn wait.ConditionFunc, initialBackoffSec int) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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