diff --git a/hypershift-operator/controllers/nodepool/capi.go b/hypershift-operator/controllers/nodepool/capi.go index 0f0dd32d1d..a6ae4f618e 100644 --- a/hypershift-operator/controllers/nodepool/capi.go +++ b/hypershift-operator/controllers/nodepool/capi.go @@ -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) } diff --git a/hypershift-operator/controllers/nodepool/openstack/openstack.go b/hypershift-operator/controllers/nodepool/openstack/openstack.go index 49cb8704dc..32e8a84dd0 100644 --- a/hypershift-operator/controllers/nodepool/openstack/openstack.go +++ b/hypershift-operator/controllers/nodepool/openstack/openstack.go @@ -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 @@ -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, }, }, },