util

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2019 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoMachineIPAddr = errors.New("no IP addresses found for machine")

ErrNoMachineIPAddr indicates that no valid IP addresses were found in a machine context

Functions

func GetAPIEndpointForControlPlaneEndpoint added in v0.5.2

func GetAPIEndpointForControlPlaneEndpoint(controlPlaneEndpoint string) (*infrav1.APIEndpoint, error)

GetAPIEndpointForControlPlaneEndpoint parses the provided ControlPlaneEndpoint and returns an APIEndpoint.

func GetKubeadmConfigForMachine added in v0.5.2

func GetKubeadmConfigForMachine(
	ctx context.Context,
	controllerClient client.Client,
	machine *clusterv1.Machine) (*bootstrapv1.KubeadmConfig, error)

GetKubeadmConfigForMachine gets a CAPI Machine's associated KubeadmConfig resource.

func GetMachineManagedObjectReference

func GetMachineManagedObjectReference(machine *infrav1.VSphereMachine) vim25types.ManagedObjectReference

GetMachineManagedObjectReference returns the managed object reference for a VSphereMachine resource.

func GetMachineMetadata

func GetMachineMetadata(hostname string, machine infrav1.VSphereMachine, networkStatus ...infrav1.NetworkStatus) ([]byte, error)

GetMachineMetadata returns the cloud-init metadata as a base-64 encoded string for a given VSphereMachine.

func GetMachinePreferredIPAddress

func GetMachinePreferredIPAddress(machine *infrav1.VSphereMachine) (string, error)

GetMachinePreferredIPAddress returns the preferred IP address for a VSphereMachine resource.

func GetMachinesInCluster

func GetMachinesInCluster(
	ctx context.Context,
	controllerClient client.Client,
	namespace, clusterName string) ([]*clusterv1.Machine, error)

GetMachinesInCluster gets a cluster's Machine resources.

func GetVSphereMachine

func GetVSphereMachine(
	ctx context.Context,
	controllerClient client.Client,
	namespace, machineName string) (*infrav1.VSphereMachine, error)

GetVSphereMachine gets a VSphereMachine resource for the given CAPI Machine.

func GetVSphereMachinesInCluster

func GetVSphereMachinesInCluster(
	ctx context.Context,
	controllerClient client.Client,
	namespace, clusterName string) ([]*infrav1.VSphereMachine, error)

GetVSphereMachinesInCluster gets a cluster's VSphereMachine resources.

func IsControlPlaneMachine

func IsControlPlaneMachine(machine *clusterv1.Machine) bool

IsControlPlaneMachine returns a flag indicating whether or not a machine has the control plane role.

func NewKubeClient

func NewKubeClient(
	ctx context.Context,
	controllerClient client.Client,
	cluster *clusterv1.Cluster) (kubernetes.Interface, error)

NewKubeClient returns a new client for the target cluster using the KubeConfig secret stored in the management cluster.

Types

This section is empty.

Jump to

Keyboard shortcuts

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