Skip to content

Switch Hypervisor from ControllerReference to OwnerReference#135

Merged
notandy merged 1 commit into
mainfrom
blocking_owner_reference
Oct 8, 2025
Merged

Switch Hypervisor from ControllerReference to OwnerReference#135
notandy merged 1 commit into
mainfrom
blocking_owner_reference

Conversation

@fwiesel

@fwiesel fwiesel commented Oct 7, 2025

Copy link
Copy Markdown
Contributor

ControllerReference is 'for reconciling the owner object on changes to controlled (with a Watch + EnqueueRequestForOwner)'.

Since we do not want to reconcile the node on changes to the hypervisor, we are fine with OwnerReference.

The WithBlockOwnerDeletion ensures that the node is only deleted, when the hypervisor resource also has been deleted. For now, it is only avoiding a theoretical race conditition of the node coming back before the hypervisor has been removed, and annotations / labels not getting propagated.

It also sets the stage for moving the finalizer out of the node, and doing that on the hypervisor resource instead.

@fwiesel fwiesel requested a review from notandy October 7, 2025 13:31
@notandy

notandy commented Oct 7, 2025

Copy link
Copy Markdown
Contributor

True, probably want to remove line 183 Owns(&kvmv1.Hypervisor{})., too since we don't wan't to watch for hypervisor changes.

@fwiesel fwiesel force-pushed the blocking_owner_reference branch from 552a89d to c9e2931 Compare October 8, 2025 06:33
@fwiesel

fwiesel commented Oct 8, 2025

Copy link
Copy Markdown
Contributor Author

I've removed the line.

ControllerReference is 'for reconciling the owner object on changes to
controlled (with a Watch + EnqueueRequestForOwner)'.

Since we do not want to reconcile the node on changes to the hypervisor,
we are fine with OwnerReference.

The WithBlockOwnerDeletion ensures that the node is only
deleted, when the hypervisor resource also has been deleted.
For now, it is only avoiding a theoretical race conditition of the
node coming back before the hypervisor has been removed,
and annotations / labels not getting propagated.

It also sets the stage for moving the finalizer out of the node,
and doing that on the hypervisor resource instead.
@notandy notandy merged commit da93795 into main Oct 8, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants