Skip to content

Commit

Permalink
Add comments to the new function definitions and rename cUUID to peUU…
Browse files Browse the repository at this point in the history
…ID parameter
  • Loading branch information
yannickstruyf3 committed Dec 1, 2023
1 parent cd6eb7c commit 2c77bd6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions api/v1beta1/conditions.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const (
// NoFailureDomainsReconciled indicates no failure domains have been defined
NoFailureDomainsReconciled capiv1.ConditionType = "NoFailureDomainsReconciled"

// FailureDomainsReconciliationFailed indicates the failure domain reconciliation failed
FailureDomainsReconciliationFailed = "FailureDomainsReconciliationFailed"
)

Expand Down
1 change: 1 addition & 0 deletions controllers/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,7 @@ func GetGPUsForPE(ctx context.Context, client *nutanixClientV3.Client, peUUID st
return gpus, nil
}

// GetFailureDomain gets the failure domain with a given name from a NutanixCluster object.
func GetFailureDomain(failureDomainName string, nutanixCluster *infrav1.NutanixCluster) (*infrav1.NutanixFailureDomain, error) {
if failureDomainName == "" {
return nil, fmt.Errorf("failure domain name must be set when searching for failure domains on a Nutanix cluster object")
Expand Down
6 changes: 3 additions & 3 deletions controllers/nutanixmachine_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -929,14 +929,14 @@ func (r *NutanixMachineReconciler) GetSubnetAndPEUUIDs(rctx *nctx.MachineContext
if err != nil {
return "", nil, fmt.Errorf("failed to find failure domain %s", failureDomainName)
}
cUUID, err := GetPEUUID(rctx.Context, rctx.NutanixClient, failureDomain.Cluster.Name, failureDomain.Cluster.UUID)
peUUID, err := GetPEUUID(rctx.Context, rctx.NutanixClient, failureDomain.Cluster.Name, failureDomain.Cluster.UUID)
if err != nil {
return "", nil, fmt.Errorf("failed to find prism element uuid for failure domain %s", failureDomainName)
}
subnetUUIDs, err := GetSubnetUUIDList(rctx.Context, rctx.NutanixClient, failureDomain.Subnets, cUUID)
subnetUUIDs, err := GetSubnetUUIDList(rctx.Context, rctx.NutanixClient, failureDomain.Subnets, peUUID)
if err != nil {
return "", nil, fmt.Errorf("failed to find subnet uuids for failure domain %s", failureDomainName)
}

return cUUID, subnetUUIDs, nil
return peUUID, subnetUUIDs, nil
}

0 comments on commit 2c77bd6

Please sign in to comment.