Documentation
¶
Index ¶
- Constants
- Variables
- func ConvertProviderIDToUUID(providerID *string) string
- func ConvertUUIDToProviderID(uuid string) string
- func GetMachineMetadata(hostname string, machine infrav1.VSphereVM, ...) ([]byte, error)
- func GetMachinePreferredIPAddress(machine *infrav1.VSphereMachine) (string, error)
- func GetMachinesInCluster(ctx context.Context, controllerClient client.Client, ...) ([]*clusterv1.Machine, error)
- func GetVSphereMachine(ctx context.Context, controllerClient client.Client, ...) (*infrav1.VSphereMachine, error)
- func GetVSphereMachinesInCluster(ctx context.Context, controllerClient client.Client, ...) ([]*infrav1.VSphereMachine, error)
- func IsControlPlaneMachine(machine metav1.Object) bool
- func NewKubeClient(ctx context.Context, controllerClient client.Client, ...) (kubernetes.Interface, error)
Constants ¶
const ( // ProviderIDPrefix is the string data prefixed to a BIOS UUID in order // to build a provider ID. ProviderIDPrefix = "vsphere://" // ProviderIDPattern is a regex pattern and is used by ConvertProviderIDToUUID // to convert a providerID into a UUID string. ProviderIDPattern = `(?i)^` + ProviderIDPrefix + `([a-f\d]{8}-[a-f\d]{4}-[a-f\d]{4}-[a-f\d]{4}-[a-f\d]{12})$` // UUIDPattern is a regex pattern and is used by ConvertUUIDToProviderID // to convert a UUID into a providerID string. UUIDPattern = `(?i)^[a-f\d]{8}-[a-f\d]{4}-[a-f\d]{4}-[a-f\d]{4}-[a-f\d]{12}$` )
Variables ¶
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 ConvertProviderIDToUUID ¶
ConvertProviderIDToUUID transforms a provider ID into a UUID string. If providerID is nil, empty, or invalid, then an empty string is returned. A valid providerID should adhere to the format specified by ProviderIDPattern.
func ConvertUUIDToProviderID ¶
ConvertUUIDToProviderID transforms a UUID string into a provider ID. If the supplied UUID is empty or invalid then an empty string is returned. A valid UUID should adhere to the format specified by UUIDPattern.
func GetMachineMetadata ¶
func GetMachineMetadata(hostname string, machine infrav1.VSphereVM, 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 ¶
IsControlPlaneMachine returns true if the provided resource is a member of the control plane.
Types ¶
This section is empty.