utils

package
v0.0.0-...-9331f55 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package utils contains utility functions shared by controllers

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ControlPlaneName

func ControlPlaneName(clusterName string) string

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 GetSecret

func GetSecret(ctx context.Context, clt client.Client, namespace, name string) (*v1.Secret, error)

GetSecret gets the secret object given its name and namespace

func GetUsernameAndPasswordFromSecret

func GetUsernameAndPasswordFromSecret(s *v1.Secret) (string, string, error)

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

func VerifyOwnerRef

func VerifyOwnerRef(k8sObject client.Object, ownerName, ownerKind string) bool

VerifyOwnerRef verifies that the ownerKind name ownerName is listed in the list of the objects owner references.

Types

This section is empty.

Jump to

Keyboard shortcuts

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