util

package
v0.0.0-...-c210e35 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: 15 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

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

GetAPIEndpointForControlPlaneEndpoint parses the provided ControlPlaneEndpoint and returns an APIEndpoint.

func GetKubeadmConfigForMachine

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

GetKubeadmConfigForMachine gets a CAPI Machine's associated KubeadmConfig resource.

func GetMachinePreferredIPAddress

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

GetMachinePreferredIPAddress returns the preferred IP address for a SakuraCloudMachine 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 GetSakuraCloudMachine

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

GetSakuraCloudMachine gets a SakuraCloudMachine resource for the given CAPI Machine.

func GetSakuraCloudMachinesInCluster

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

GetSakuraCloudMachinesInCluster gets a cluster's SakuraCloudMachine 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