util

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateClientProviderFromClusterIdentity

func CreateClientProviderFromClusterIdentity(ctx context.Context, client client.Client, namespace string, defaultRegion string, clusterAccessor scope.OCIClusterAccessor, identityRef *corev1.ObjectReference) (*scope.ClientProvider, error)

CreateClientProviderFromClusterIdentity creates scope.ClientProvider from Cluster Identity

func CreateMachinePoolMachinesIfNotExists added in v0.13.0

func CreateMachinePoolMachinesIfNotExists(ctx context.Context, params MachineParams) error

CreateMachinePoolMachinesIfNotExists creates the machine pool machines if not exists. This method lists the existing machines in the clusters and does a diff, and creates any missing machines based ont he spec provided.

func DeleteOrphanedMachinePoolMachines added in v0.13.0

func DeleteOrphanedMachinePoolMachines(ctx context.Context, params MachineParams) error

DeleteOrphanedMachinePoolMachines deletes the machine pool machines which are not required. This method lists the existing machines in the clusters and does a diff with the spec and deletes any machines which are missing from the spec.

func GetClusterIdentityFromRef

func GetClusterIdentityFromRef(ctx context.Context, c client.Client, ociClusterNamespace string, ref *corev1.ObjectReference) (*infrastructurev1beta2.OCIClusterIdentity, error)

GetClusterIdentityFromRef returns the OCIClusterIdentity referenced by the OCICluster.

func GetOrBuildClientFromIdentity

func GetOrBuildClientFromIdentity(ctx context.Context, c client.Client, identity *infrastructurev1beta2.OCIClusterIdentity, defaultRegion string, clientOverrides *infrastructurev1beta2.ClientOverrides, namespace string) (*scope.ClientProvider, error)

GetOrBuildClientFromIdentity creates ClientProvider from OCIClusterIdentity object

func InitClientsAndRegion

func InitClientsAndRegion(ctx context.Context, client client.Client, defaultRegion string, clusterAccessor scope.OCIClusterAccessor, defaultClientProvider *scope.ClientProvider) (*scope.ClientProvider, string, scope.OCIClients, error)

InitClientsAndRegion initializes the OCI Clients and Region based on various parameters

func IsClusterNamespaceAllowed

func IsClusterNamespaceAllowed(ctx context.Context, k8sClient client.Client, allowedNamespaces *infrastructurev1beta2.AllowedNamespaces, namespace string) bool

IsClusterNamespaceAllowed indicates if the cluster namespace is allowed.

Types

type MachineParams added in v0.13.0

type MachineParams struct {
	Client               client.Client                      // the kubernetes client
	MachinePool          *expclusterv1.MachinePool          // the corresponding machinepool
	Cluster              *clusterv1.Cluster                 // the corresponding cluster
	InfraMachinePoolName string                             // the name of the infra machinepool corresponding(can be managed/self managed/virtual)
	InfraMachinePoolKind string                             // the kind of infra machinepool(can be managed/self managed/virtual)
	InfraMachinePoolUID  types.UID                          // the UID of the infra machinepool
	Namespace            string                             // the namespace in which machinepool machine has to be created
	SpecInfraMachines    []infrav2exp.OCIMachinePoolMachine // the spec of actual machines in the pool
	Logger               *logr.Logger                       // the logger which has to be used
}

MachineParams specifies the params required to create or delete machinepool machines. Infra machine pool specifed below refers to OCIManagedMachinePool/OCIMachinePool/OCIVirtualMachinePool

Jump to

Keyboard shortcuts

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