Skip to content

Commit

Permalink
update ownerref
Browse files Browse the repository at this point in the history
  • Loading branch information
MaysaMacedo committed Dec 26, 2024
1 parent 97a5e4a commit 6ca906e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion hypershift-operator/controllers/nodepool/capi.go
Original file line number Diff line number Diff line change
Expand Up @@ -1325,5 +1325,5 @@ func (r *NodePoolReconciler) getMachinesForNodePool(ctx context.Context, nodePoo
}

func (c *CAPI) reconcileORCResources(ctx context.Context) error {
return openstack.ReconcileOpenStackImageCR(ctx, c.Client, c.CreateOrUpdate, c.hostedCluster, c.releaseImage, c.controlplaneNamespace)
return openstack.ReconcileOpenStackImageCR(ctx, c.Client, c.CreateOrUpdate, c.hostedCluster, c.releaseImage, c.controlplaneNamespace, c.nodePool)
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func MachineTemplateSpec(hcluster *hyperv1.HostedCluster, nodePool *hyperv1.Node
return openStackMachineTemplate, nil
}

func ReconcileOpenStackImageCR(ctx context.Context, client client.Client, createOrUpdate upsert.CreateOrUpdateFN, hcluster *hyperv1.HostedCluster, release *releaseinfo.ReleaseImage, controlPlaneNamespace string) error {
func ReconcileOpenStackImageCR(ctx context.Context, client client.Client, createOrUpdate upsert.CreateOrUpdateFN, hcluster *hyperv1.HostedCluster, release *releaseinfo.ReleaseImage, controlPlaneNamespace string, nodePool *hyperv1.NodePool) error {
releaseVersion, err := releaseinfo.OpenStackReleaseImage(release)
if err != nil {
return err
Expand All @@ -93,10 +93,9 @@ func ReconcileOpenStackImageCR(ctx context.Context, client client.Client, create
// TODO: add proper cleanup in CAPI resources cleanup
OwnerReferences: []metav1.OwnerReference{
{
APIVersion: hcluster.APIVersion,
Kind: hcluster.Kind,
Name: hcluster.Name,
UID: hcluster.UID,
APIVersion: "cluster.x-k8s.io/v1beta1",
Kind: "MachineDeployment",
Name: nodePool.Name,
},
},
},
Expand Down

0 comments on commit 6ca906e

Please sign in to comment.