Documentation ¶
Overview ¶
Package utils contains utility functions shared by controllers
Index ¶
- func ControlPlaneName(clusterName string) string
- func ControlPlaneVsphereMachineTemplateNonParavirtualForCluster(ctx context.Context, clt client.Client, cluster *clusterapiv1beta1.Cluster) (*capvv1beta1.VSphereMachineTemplate, error)
- func GetCCMName(cluster *clusterapiv1beta1.Cluster) string
- func GetOwnerCluster(ctx context.Context, k8sClient client.Client, k8sObject client.Object, ...) (*clusterapiv1beta1.Cluster, error)
- func GetSecret(ctx context.Context, clt client.Client, namespace, name string) (*v1.Secret, error)
- func GetUsernameAndPasswordFromSecret(s *v1.Secret) (string, string, error)
- func TryParseClusterVariableBool(ctx context.Context, cluster *clusterapiv1beta1.Cluster, variableName string) bool
- func TryParseClusterVariableString(ctx context.Context, cluster *clusterapiv1beta1.Cluster, variableName string) string
- func VSphereClusterNonParavirtualForCluster(ctx context.Context, clt client.Client, cluster *clusterapiv1beta1.Cluster) (*capvv1beta1.VSphereCluster, error)
- func VSphereClusterParavirtualForCAPICluster(ctx context.Context, clt client.Client, cluster *clusterapiv1beta1.Cluster) (*capvvmwarev1beta1.VSphereCluster, error)
- func VerifyOwnerRef(k8sObject client.Object, ownerName, ownerKind string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ControlPlaneName ¶
ControlPlaneName returns the control plane name for a cluster name
func ControlPlaneVsphereMachineTemplateNonParavirtualForCluster ¶
func ControlPlaneVsphereMachineTemplateNonParavirtualForCluster(ctx context.Context, clt client.Client, cluster *clusterapiv1beta1.Cluster) (*capvv1beta1.VSphereMachineTemplate, error)
ControlPlaneVsphereMachineTemplateNonParavirtualForCluster gets the VsphereMachineTemplate CR of control plane
func GetCCMName ¶
func GetCCMName(cluster *clusterapiv1beta1.Cluster) string
GetCCMName returns the name of cloud control manager for a cluster
func GetOwnerCluster ¶
func GetOwnerCluster(ctx context.Context, k8sClient client.Client, k8sObject client.Object, namespace, pkgRefName string) (*clusterapiv1beta1.Cluster, error)
GetOwnerCluster returns cluster owner for the object. Returns cluster=nil and err if no cluster can be determined as owner. Returns cluster object with only name and namespace and err, if details for the cluster listed as owner reference can not be found.
func GetUsernameAndPasswordFromSecret ¶
GetUsernameAndPasswordFromSecret extracts a username and password from secret
func TryParseClusterVariableBool ¶
func TryParseClusterVariableBool(ctx context.Context, cluster *clusterapiv1beta1.Cluster, variableName string) bool
TryParseClusterVariableBool tries to parse a boolean cluster variable, info any error that occurs
func TryParseClusterVariableString ¶
func TryParseClusterVariableString(ctx context.Context, cluster *clusterapiv1beta1.Cluster, variableName string) string
TryParseClusterVariableString tries to parse a string cluster variable, info any error that occurs
func VSphereClusterNonParavirtualForCluster ¶
func VSphereClusterNonParavirtualForCluster(ctx context.Context, clt client.Client, cluster *clusterapiv1beta1.Cluster) (*capvv1beta1.VSphereCluster, error)
VSphereClusterNonParavirtualForCluster gets the VSphereCluster CR for the cluster object in non-paravirtual mode
func VSphereClusterParavirtualForCAPICluster ¶
func VSphereClusterParavirtualForCAPICluster(ctx context.Context, clt client.Client, cluster *clusterapiv1beta1.Cluster) (*capvvmwarev1beta1.VSphereCluster, error)
VSphereClusterParavirtualForCAPICluster gets the VSphereCluster CR for the cluster object in paravirtual mode
Types ¶
This section is empty.