controllers

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2023 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateNutanixClient

func CreateNutanixClient(secretInformer coreinformers.SecretInformer, cmInformer coreinformers.ConfigMapInformer, nutanixCluster *infrav1.NutanixCluster) (*nutanixClientV3.Client, error)

CreateNutanixClient creates a new Nutanix client from the environment

func CreateSystemDiskSpec added in v1.1.1

func CreateSystemDiskSpec(imageUUID string, systemDiskSize int64) (*nutanixClientV3.VMDisk, error)

func DeleteCategories added in v1.1.1

func DeleteCategories(ctx context.Context, client *nutanixClientV3.Client, categoryIdentifiers []*infrav1.NutanixCategoryIdentifier) error

DeleteCategories deletes the given list of categories

func DeleteVM added in v1.1.1

func DeleteVM(ctx context.Context, client *nutanixClientV3.Client, vmName, vmUUID string) (string, error)

DeleteVM deletes a VM and is invoked by the NutanixMachineReconciler

func FindVM added in v1.1.1

FindVM retrieves the VM with the given uuid or name

func FindVMByName added in v1.1.1

func FindVMByName(ctx context.Context, client *nutanixClientV3.Client, vmName string) (*nutanixClientV3.VMIntentResponse, error)

FindVMByName retrieves the VM with the given vm name

func FindVMByUUID added in v1.1.1

FindVMByUUID retrieves the VM with the given vm UUID. Returns nil if not found

func GenerateProviderID added in v1.1.1

func GenerateProviderID(uuid string) string

GenerateProviderID generates a provider ID for the given resource UUID

func GetCategoryVMSpec added in v1.1.1

func GetCategoryVMSpec(ctx context.Context, client *nutanixClientV3.Client, categoryIdentifiers []*infrav1.NutanixCategoryIdentifier) (map[string]string, error)

GetCategoryVMSpec returns a flatmap of categories and their values

func GetDefaultCAPICategoryIdentifiers added in v1.1.1

func GetDefaultCAPICategoryIdentifiers(clusterName string) []*infrav1.NutanixCategoryIdentifier

GetDefaultCAPICategoryIdentifiers returns the default CAPI category identifiers

func GetImageUUID added in v1.1.1

func GetImageUUID(ctx context.Context, client *nutanixClientV3.Client, imageName, imageUUID *string) (string, error)

GetImageUUID returns the UUID of the image with the given name

func GetMibValueOfQuantity added in v1.1.1

func GetMibValueOfQuantity(quantity resource.Quantity) int64

GetMibValueOfQuantity returns the given quantity value in Mib

func GetOrCreateCategories added in v1.1.1

func GetOrCreateCategories(ctx context.Context, client *nutanixClientV3.Client, categoryIdentifiers []*infrav1.NutanixCategoryIdentifier) ([]*nutanixClientV3.CategoryValueStatus, error)

GetOrCreateCategories returns the list of category UUIDs for the given list of category names

func GetPEUUID added in v1.1.1

func GetPEUUID(ctx context.Context, client *nutanixClientV3.Client, peName, peUUID *string) (string, error)

GetPEUUID returns the UUID of the Prism Element cluster with the given name

func GetProjectUUID added in v1.1.1

func GetProjectUUID(ctx context.Context, client *nutanixClientV3.Client, projectName, projectUUID *string) (string, error)

GetProjectUUID returns the UUID of the project with the given name

func GetSubnetUUID added in v1.1.1

func GetSubnetUUID(ctx context.Context, client *nutanixClientV3.Client, peUUID string, subnetName, subnetUUID *string) (string, error)

GetSubnetUUID returns the UUID of the subnet with the given name

func GetSubnetUUIDList added in v1.1.1

func GetSubnetUUIDList(ctx context.Context, client *nutanixClientV3.Client, machineSubnets []infrav1.NutanixResourceIdentifier, peUUID string) ([]string, error)

GetSubnetUUIDList returns a list of subnet UUIDs for the given list of subnet names

func GetTaskUUIDFromVM added in v1.1.1

func GetTaskUUIDFromVM(vm *nutanixClientV3.VMIntentResponse) (string, error)

GetTaskUUIDFromVM returns the UUID of the task that created the VM with the given UUID

func GetVMUUID added in v1.1.1

func GetVMUUID(ctx context.Context, nutanixMachine *infrav1.NutanixMachine) (string, error)

GetVMUUID returns the UUID of the VM with the given name

func HasTaskInProgress added in v1.1.1

func HasTaskInProgress(ctx context.Context, client *nutanixClientV3.Client, taskUUID string) (bool, error)

HasTaskInProgress returns true if the given task is in progress

Types

type NutanixClusterReconciler

type NutanixClusterReconciler struct {
	Client            client.Client
	SecretInformer    coreinformers.SecretInformer
	ConfigMapInformer coreinformers.ConfigMapInformer
	Scheme            *runtime.Scheme
}

NutanixClusterReconciler reconciles a NutanixCluster object

func NewNutanixClusterReconciler added in v1.1.1

func NewNutanixClusterReconciler(client client.Client, secretInformer coreinformers.SecretInformer, configMapInformer coreinformers.ConfigMapInformer, scheme *runtime.Scheme) *NutanixClusterReconciler

func (*NutanixClusterReconciler) Reconcile

func (r *NutanixClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request) (res ctrl.Result, reterr error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the NutanixCluster object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.8.3/pkg/reconcile

func (*NutanixClusterReconciler) SetupWithManager

func (r *NutanixClusterReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager) error

SetupWithManager sets up the NutanixCluster controller with the Manager.

type NutanixMachineReconciler

type NutanixMachineReconciler struct {
	client.Client
	SecretInformer    coreinformers.SecretInformer
	ConfigMapInformer coreinformers.ConfigMapInformer
	Scheme            *runtime.Scheme
}

NutanixMachineReconciler reconciles a NutanixMachine object

func NewNutanixMachineReconciler added in v1.1.1

func NewNutanixMachineReconciler(client client.Client, secretInformer coreinformers.SecretInformer, configMapInformer coreinformers.ConfigMapInformer, scheme *runtime.Scheme) *NutanixMachineReconciler

func (*NutanixMachineReconciler) Reconcile

func (r *NutanixMachineReconciler) Reconcile(ctx context.Context, req ctrl.Request) (res ctrl.Result, reterr error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the NutanixMachine object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.8.3/pkg/reconcile

func (*NutanixMachineReconciler) SetupWithManager

func (r *NutanixMachineReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

Jump to

Keyboard shortcuts

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