Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertIPAddrsToPreAllocations(ipAddrs []string) map[string]string
- func ConvertProviderIDToUUID(providerID *string) string
- func ConvertUUIDToProviderID(uuid string) string
- func CreateOrUpdateIPAddress(ctx *context.VMContext, ipAddressName string, network basetypv1.Nic) (runtime.Object, error)
- func FetchControlPlaneOwnerObject(input FetchObjectInput) (ctrlclient.Object, error)
- func FetchMachineDeploymentOwnerObject(input FetchObjectInput) (ctrlclient.Object, error)
- func GetControlPlaneICSMachinesInCluster(ctx context.Context, controllerClient client.Client, ...) ([]*infrav1.ICSMachine, error)
- func GetICSClusterFromICSMachine(ctx context.Context, c client.Client, machine *infrav1.ICSMachine) (*infrav1.ICSCluster, error)
- func GetICSMachineByName(ctx context.Context, c client.Client, namespace, name string) (*infrav1.ICSMachine, error)
- func GetICSMachinesInCluster(ctx context.Context, controllerClient client.Client, ...) ([]*infrav1.ICSMachine, error)
- func GetIPAddressByCIDR(cidr string, filter map[string]string) (net.IP, error)
- func GetIPFromNetworkConfig(ctx *context.VMContext, network *infrav1.NetworkDeviceSpec) (*string, *string, error)
- func GetMachineByName(ctx context.Context, c client.Client, namespace, name string) (*clusterv1.Machine, error)
- func GetMachineMetadata(hostname string, icsVM infrav1.ICSVM, networkStatuses ...infrav1.NetworkStatus) ([]byte, error)
- func GetMachinePreferredIPAddress(machine *infrav1.ICSMachine) (string, error)
- func GetMachinesInCluster(ctx context.Context, controllerClient client.Client, ...) ([]*clusterv1.Machine, error)
- func GetOwnerICSMachine(ctx context.Context, c client.Client, obj metav1.ObjectMeta) (*infrav1.ICSMachine, error)
- func GetOwnerMachine(ctx context.Context, c client.Client, obj metav1.ObjectMeta) (*clusterv1.Machine, error)
- func IsControlPlaneMachine(machine metav1.Object) bool
- func IsNotFoundError(err error) bool
- func MachinesAsString(machines []*clusterv1.Machine) string
- func NewKubeClient(ctx context.Context, controllerClient client.Client, ...) (kubernetes.Interface, error)
- func SanitizeHostInfoLabel(info string) string
- func UpdateNetworkInfo(ctx *context.VMContext, networkStatus []infrav1.NetworkStatus)
- type FetchObjectInput
Constants ¶
const ( // ProviderIDPrefix is the string data prefixed to a BIOS UUID in order // to build a provider ID. ProviderIDPrefix = "ics://" // 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 ConvertIPAddrsToPreAllocations ¶
ConvertIPAddrsToIPs transforms a ipAddrs strings into PreAllocations IP.
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 CreateOrUpdateIPAddress ¶
func FetchControlPlaneOwnerObject ¶
func FetchControlPlaneOwnerObject(input FetchObjectInput) (ctrlclient.Object, error)
func FetchMachineDeploymentOwnerObject ¶
func FetchMachineDeploymentOwnerObject(input FetchObjectInput) (ctrlclient.Object, error)
func GetControlPlaneICSMachinesInCluster ¶ added in v1.0.2
func GetControlPlaneICSMachinesInCluster(ctx context.Context, controllerClient client.Client, namespace, clusterName string) ([]*infrav1.ICSMachine, error)
GetControlPlaneICSMachinesInCluster gets a cluster's ICSMachine resources.
func GetICSClusterFromICSMachine ¶
func GetICSClusterFromICSMachine(ctx context.Context, c client.Client, machine *infrav1.ICSMachine) (*infrav1.ICSCluster, error)
GetICSClusterFromICSMachine gets the infrastructure.cluster.x-k8s.io.ICSCluster resource for the given ICSMachine.
func GetICSMachineByName ¶
func GetICSMachinesInCluster ¶
func GetICSMachinesInCluster(ctx context.Context, controllerClient client.Client, namespace, clusterName string) ([]*infrav1.ICSMachine, error)
GetICSMachinesInCluster gets a cluster's ICSMachine resources.
func GetIPAddressByCIDR ¶
GetIPAddressByCIDR generate ip
func GetIPFromNetworkConfig ¶
func GetIPFromNetworkConfig( ctx *context.VMContext, network *infrav1.NetworkDeviceSpec) (*string, *string, error)
GetIPFromPools from cluster template
func GetMachineByName ¶ added in v1.0.2
func GetMachineMetadata ¶
func GetMachineMetadata(hostname string, icsVM infrav1.ICSVM, networkStatuses ...infrav1.NetworkStatus) ([]byte, error)
GetMachineMetadata returns the cloud-init metadata as a base-64 encoded string for a given ICSMachine.
func GetMachinePreferredIPAddress ¶
func GetMachinePreferredIPAddress(machine *infrav1.ICSMachine) (string, error)
GetMachinePreferredIPAddress returns the preferred IP address for a ICSMachine resource.
func GetMachinesInCluster ¶
func GetMachinesInCluster( ctx context.Context, controllerClient client.Client, namespace, clusterName string) ([]*clusterv1.Machine, error)
GetMachinesInCluster gets a cluster's Machine resources. I6_spur!
func GetOwnerICSMachine ¶
func GetOwnerICSMachine(ctx context.Context, c client.Client, obj metav1.ObjectMeta) (*infrav1.ICSMachine, error)
func GetOwnerMachine ¶ added in v1.0.2
func IsControlPlaneMachine ¶
IsControlPlaneMachine returns true if the provided resource is a member of the control plane.
func IsNotFoundError ¶
func MachinesAsString ¶
MachinesAsString constructs a string (with correct punctuations) to be used in logging and error messages.
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.
func SanitizeHostInfoLabel ¶
SanitizeHostInfoLabel ensures that the iNode host information passed as a parameter confirms to the label value constraints documented at https://k8s.io/docs/concepts/overview/working-with-objects/labels/#syntax-and-character-set
The expected inputs for the object are IP addresses of the iNode hosts.
func UpdateNetworkInfo ¶
func UpdateNetworkInfo(ctx *context.VMContext, networkStatus []infrav1.NetworkStatus)
Types ¶
type FetchObjectInput ¶
type FetchObjectInput struct { context.Context ctrlclient.Client Object ctrlclient.Object }