Documentation
¶
Index ¶
- Constants
- func CreateDataDiskList(ctx context.Context, convergedClient *v4Converged.Client, ...) ([]vmmconfig.Disk, []vmmconfig.CdRom, error)
- func CreateSystemDiskSpec(imageUUID string, systemDiskSizeInBytes int64) (*vmmconfig.Disk, error)
- func DeleteCategories(ctx context.Context, clientV4 *v4Converged.Client, ...) error
- func DeleteVM(ctx context.Context, client *v4Converged.Client, vmName, vmUUID string) (string, error)
- func FindVM(ctx context.Context, client *v4Converged.Client, machine *capiv1beta2.Machine, ...) (*vmmconfig.Vm, error)
- func FindVMByName(ctx context.Context, client *v4Converged.Client, vmName string) (*vmmconfig.Vm, error)
- func FindVMByUUID(ctx context.Context, client *v4Converged.Client, uuid string) (*vmmconfig.Vm, error)
- func GenerateProviderID(uuid string) string
- func GetDefaultCAPICategoryIdentifiers(clusterName string) []*infrav1.NutanixCategoryIdentifier
- func GetGPU(ctx context.Context, client *v4Converged.Client, peUUID string, ...) (*vmmconfig.Gpu, error)
- func GetGPUList(ctx context.Context, client *v4Converged.Client, gpus []infrav1.NutanixGPU, ...) ([]vmmconfig.Gpu, error)
- func GetGPUsForPE(ctx context.Context, client *v4Converged.Client, peUUID string, ...) ([]*vmmconfig.Gpu, error)
- func GetImage(ctx context.Context, client *v4Converged.Client, ...) (*imageModels.Image, error)
- func GetImageByLookup(ctx context.Context, client *v4Converged.Client, ...) (*imageModels.Image, error)
- func GetLegacyFailureDomainFromNutanixCluster(failureDomainName string, nutanixCluster *infrav1.NutanixCluster) *infrav1.NutanixFailureDomainConfig
- func GetMibValueOfQuantity(quantity resource.Quantity) int64
- func GetObsoleteDefaultCAPICategoryIdentifiers(clusterName string) []*infrav1.NutanixCategoryIdentifier
- func GetOrCreateCategories(ctx context.Context, client *v4Converged.Client, ...) ([]*prismModels.Category, error)
- func GetPEUUID(ctx context.Context, client *v4Converged.Client, peName, peUUID *string) (string, error)
- func GetPrismReferencesOfCategoryIdentifiers(ctx context.Context, client *v4Converged.Client, ...) ([]vmmconfig.CategoryReference, error)
- func GetProjectUUID(ctx context.Context, client *prismclientv3.Client, ...) (string, error)
- func GetStorageContainerInCluster(ctx context.Context, client *v4Converged.Client, ...) (*clusterModels.StorageContainer, error)
- func GetSubnetUUID(ctx context.Context, client *v4Converged.Client, peUUID string, ...) (string, error)
- func GetSubnetUUIDList(ctx context.Context, client *v4Converged.Client, ...) ([]string, error)
- func GetVMUUID(machine *capiv1beta2.Machine, nutanixMachine *infrav1.NutanixMachine) (string, error)
- func ImageMarkedForDeletion(ctx context.Context, client *v4Converged.Client, image *imageModels.Image) (bool, error)
- func VmHasTaskInProgress(ctx context.Context, client *v4Converged.Client, vmExtId string) (bool, error)
- type ControllerConfig
- type ControllerConfigOpts
- type ImageLookup
- type NutanixClusterReconciler
- type NutanixFailureDomainReconciler
- type NutanixMachineReconciler
- func (r *NutanixMachineReconciler) GetSubnetAndPEUUIDs(rctx *nctx.MachineContext) (string, []string, error)
- func (r *NutanixMachineReconciler) Reconcile(ctx context.Context, req ctrl.Request) (res ctrl.Result, reterr error)
- func (r *NutanixMachineReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager) error
- type StorageContainerIntentResponse
Constants ¶
const ( ImageStateDeletePending = "DELETE_PENDING" ImageStateDeleteInProgress = "DELETE_IN_PROGRESS" )
Variables ¶
This section is empty.
Functions ¶
func CreateDataDiskList ¶ added in v1.6.0
func CreateDataDiskList(ctx context.Context, convergedClient *v4Converged.Client, dataDiskSpecs []infrav1.NutanixMachineVMDisk, peUUID string) ([]vmmconfig.Disk, []vmmconfig.CdRom, error)
CreateDataDiskList creates a list of data disks and cdRoms with the given data disk specs
func CreateSystemDiskSpec ¶ added in v1.1.1
func DeleteCategories ¶ added in v1.1.1
func DeleteCategories(ctx context.Context, clientV4 *v4Converged.Client, categoryIdentifiers, obsoleteCategoryIdentifiers []*infrav1.NutanixCategoryIdentifier) error
DeleteCategories deletes the given list of categories
func DeleteVM ¶ added in v1.1.1
func DeleteVM(ctx context.Context, client *v4Converged.Client, vmName, vmUUID string) (string, error)
DeleteVM deletes a VM and is invoked by the NutanixMachineReconciler
func FindVM ¶ added in v1.1.1
func FindVM(ctx context.Context, client *v4Converged.Client, machine *capiv1beta2.Machine, nutanixMachine *infrav1.NutanixMachine, vmName string) (*vmmconfig.Vm, error)
FindVM retrieves the VM with the given uuid or name
func FindVMByName ¶ added in v1.1.1
func FindVMByName(ctx context.Context, client *v4Converged.Client, vmName string) (*vmmconfig.Vm, error)
FindVMByName retrieves the VM with the given vm name
func FindVMByUUID ¶ added in v1.1.1
func FindVMByUUID(ctx context.Context, client *v4Converged.Client, uuid string) (*vmmconfig.Vm, error)
FindVMByUUID retrieves the VM with the given vm UUID. Returns nil if not found
func GenerateProviderID ¶ added in v1.1.1
GenerateProviderID generates a provider ID for the given resource UUID
func GetDefaultCAPICategoryIdentifiers ¶ added in v1.1.1
func GetDefaultCAPICategoryIdentifiers(clusterName string) []*infrav1.NutanixCategoryIdentifier
GetDefaultCAPICategoryIdentifiers returns the default CAPI category identifiers
func GetGPU ¶ added in v1.2.0
func GetGPU(ctx context.Context, client *v4Converged.Client, peUUID string, gpu infrav1.NutanixGPU) (*vmmconfig.Gpu, error)
GetGPUDeviceID returns the device ID of a GPU with the given name
func GetGPUList ¶ added in v1.2.0
func GetGPUList(ctx context.Context, client *v4Converged.Client, gpus []infrav1.NutanixGPU, peUUID string) ([]vmmconfig.Gpu, error)
GetGPUList returns a list of GPU device IDs for the given list of GPUs
func GetGPUsForPE ¶ added in v1.2.0
func GetGPUsForPE(ctx context.Context, client *v4Converged.Client, peUUID string, gpu infrav1.NutanixGPU) ([]*vmmconfig.Gpu, error)
func GetImage ¶ added in v1.5.4
func GetImage(ctx context.Context, client *v4Converged.Client, id infrav1.NutanixResourceIdentifier) (*imageModels.Image, error)
GetImage returns an image. If no UUID is provided, returns the unique image with the name. Returns an error if no image has the UUID, if no image has the name, or more than one image has the name.
func GetImageByLookup ¶ added in v1.6.0
func GetImageByLookup( ctx context.Context, client *v4Converged.Client, imageTemplate, imageLookupBaseOS, k8sVersion *string, ) (*imageModels.Image, error)
func GetLegacyFailureDomainFromNutanixCluster ¶ added in v1.7.0
func GetLegacyFailureDomainFromNutanixCluster(failureDomainName string, nutanixCluster *infrav1.NutanixCluster) *infrav1.NutanixFailureDomainConfig
GetLegacyFailureDomainFromNutanixCluster gets the failure domain with a given name from a NutanixCluster object.
func GetMibValueOfQuantity ¶ added in v1.1.1
GetMibValueOfQuantity returns the given quantity value in Mib
func GetObsoleteDefaultCAPICategoryIdentifiers ¶ added in v1.2.0
func GetObsoleteDefaultCAPICategoryIdentifiers(clusterName string) []*infrav1.NutanixCategoryIdentifier
GetObsoleteDefaultCAPICategoryIdentifiers returns the default CAPI category identifiers
func GetOrCreateCategories ¶ added in v1.1.1
func GetOrCreateCategories(ctx context.Context, client *v4Converged.Client, categoryIdentifiers []*infrav1.NutanixCategoryIdentifier) ([]*prismModels.Category, 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 *v4Converged.Client, peName, peUUID *string) (string, error)
GetPEUUID returns the UUID of the Prism Element cluster with the given name
func GetPrismReferencesOfCategoryIdentifiers ¶ added in v1.8.0
func GetPrismReferencesOfCategoryIdentifiers( ctx context.Context, client *v4Converged.Client, categoryIdentifiers []*infrav1.NutanixCategoryIdentifier, ) ([]vmmconfig.CategoryReference, error)
func GetProjectUUID ¶ added in v1.1.1
func GetProjectUUID(ctx context.Context, client *prismclientv3.Client, projectName, projectUUID *string) (string, error)
GetProjectUUID returns the UUID of the project with the given name
func GetStorageContainerInCluster ¶ added in v1.6.0
func GetStorageContainerInCluster(ctx context.Context, client *v4Converged.Client, storageContainerIdentifier, clusterIdentifier infrav1.NutanixResourceIdentifier) (*clusterModels.StorageContainer, error)
func GetSubnetUUID ¶ added in v1.1.1
func GetSubnetUUID(ctx context.Context, client *v4Converged.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 *v4Converged.Client, machineSubnets []infrav1.NutanixResourceIdentifier, peUUID string) ([]string, error)
GetSubnetUUIDList returns a list of subnet UUIDs for the given list of subnet names
func GetVMUUID ¶ added in v1.1.1
func GetVMUUID(machine *capiv1beta2.Machine, nutanixMachine *infrav1.NutanixMachine) (string, error)
GetVMUUID returns the UUID of the VM.
func ImageMarkedForDeletion ¶ added in v1.5.4
func ImageMarkedForDeletion(ctx context.Context, client *v4Converged.Client, image *imageModels.Image) (bool, error)
func VmHasTaskInProgress ¶ added in v1.8.0
Types ¶
type ControllerConfig ¶ added in v1.1.3
type ControllerConfig struct {
MaxConcurrentReconciles int
RateLimiter workqueue.TypedRateLimiter[reconcile.Request]
SkipNameValidation bool
}
ControllerConfig is the configuration for cluster and machine controllers
type ControllerConfigOpts ¶ added in v1.1.3
type ControllerConfigOpts func(*ControllerConfig) error
ControllerConfigOpts is a function that can be used to configure the controller config
func WithMaxConcurrentReconciles ¶ added in v1.1.3
func WithMaxConcurrentReconciles(max int) ControllerConfigOpts
WithMaxConcurrentReconciles sets the maximum number of concurrent reconciles
func WithRateLimiter ¶ added in v1.2.5
func WithRateLimiter(rateLimiter workqueue.TypedRateLimiter[reconcile.Request]) ControllerConfigOpts
WithRateLimiter sets the rate limiter for the controller
func WithSkipNameValidation ¶ added in v1.7.0
func WithSkipNameValidation(skip bool) ControllerConfigOpts
WithSkipNameValidation sets whether to skip name validation in controller options
type ImageLookup ¶ added in v1.6.0
type NutanixClusterReconciler ¶
type NutanixClusterReconciler struct {
Client client.Client
SecretInformer coreinformers.SecretInformer
ConfigMapInformer coreinformers.ConfigMapInformer
Scheme *runtime.Scheme
// contains filtered or unexported fields
}
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, copts ...ControllerConfigOpts) (*NutanixClusterReconciler, error)
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 ¶
SetupWithManager sets up the NutanixCluster controller with the Manager.
type NutanixFailureDomainReconciler ¶ added in v1.7.0
type NutanixFailureDomainReconciler struct {
client.Client
SecretInformer coreinformers.SecretInformer
ConfigMapInformer coreinformers.ConfigMapInformer
Scheme *runtime.Scheme
// contains filtered or unexported fields
}
NutanixFailureDomainReconciler reconciles a NutanixFailureDomain object
func NewNutanixFailureDomainReconciler ¶ added in v1.7.0
func NewNutanixFailureDomainReconciler(client client.Client, secretInformer coreinformers.SecretInformer, configMapInformer coreinformers.ConfigMapInformer, scheme *runtime.Scheme, copts ...ControllerConfigOpts) (*NutanixFailureDomainReconciler, error)
func (*NutanixFailureDomainReconciler) Reconcile ¶ added in v1.7.0
func (r *NutanixFailureDomainReconciler) 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 NutanixFailureDomain 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 (*NutanixFailureDomainReconciler) SetupWithManager ¶ added in v1.7.0
func (r *NutanixFailureDomainReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager) error
SetupWithManager sets up the NutanixFailureDomain controller with the Manager.
type NutanixMachineReconciler ¶
type NutanixMachineReconciler struct {
client.Client
SecretInformer coreinformers.SecretInformer
ConfigMapInformer coreinformers.ConfigMapInformer
Scheme *runtime.Scheme
// contains filtered or unexported fields
}
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, copts ...ControllerConfigOpts) (*NutanixMachineReconciler, error)
func (*NutanixMachineReconciler) GetSubnetAndPEUUIDs ¶ added in v1.3.0
func (r *NutanixMachineReconciler) GetSubnetAndPEUUIDs(rctx *nctx.MachineContext) (string, []string, error)
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 ¶
SetupWithManager sets up the controller with the Manager.