Skip to content

GardenerNodeLifecycle: Base reconcile on Hypervisor CRD, not Node#325

Draft
fwiesel wants to merge 3 commits into
mainfrom
gardener-node-lifecycle-hv
Draft

GardenerNodeLifecycle: Base reconcile on Hypervisor CRD, not Node#325
fwiesel wants to merge 3 commits into
mainfrom
gardener-node-lifecycle-hv

Conversation

@fwiesel

@fwiesel fwiesel commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Switches the GardenerNodeLifecycleController to watch and reconcile the Hypervisor CRD as its primary resource instead of the Node. This removes the need to label nodes and aligns the controller with the rest of the operator's ownership model.

Includes updated controller tests.

Prerequisite for: offboarding-ha-disabling-optional (#268).

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d29a9463-bea4-43ef-b2bc-8e4e2814a65f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch gardener-node-lifecycle-hv

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…tamp

Gardener is moving away from setting a Terminating node condition and will
instead simply delete the Node. Add node.deletionTimestamp as a second trigger
for the Terminating condition on the Hypervisor, alongside the existing legacy
node condition check. Both inputs produce the same result: ConditionTypeTerminating=True
with ConditionReasonTerminating.

The same dual-check is applied to the Spec.Maintenance seeding on first
Hypervisor creation, so a node that is already being deleted when its Hypervisor
CR is first created correctly enters MaintenanceTermination.
@fwiesel fwiesel force-pushed the gardener-node-lifecycle-hv branch from a2ee26b to ed8f746 Compare July 10, 2026 12:06
fwiesel added 2 commits July 10, 2026 14:53
The eviction will now be triggered by the maintenance-operator, so drop
setting the label.

Watch the conditions on the hypervisor and manage the pods /
deployments in kube-system to signal gardener that
- the node is ready when the onboarding condition is completed
- the node can be drained (and therefor terminated) if it has been
  evicted
- Add missing ctx SpecContext parameter to BeforeEach/It callbacks
- Fix undefined variable references (podName -> maintenanceName,
  hypervisorName -> name)
- Fix missing closing paren in It block
- Qualify ConditionTypeOnboarding with kvmv1 package prefix
- Add JustBeforeEach reconcile calls to PDB and deployment contexts
  so assertions run against actual controller output
@fwiesel fwiesel force-pushed the gardener-node-lifecycle-hv branch from ed8f746 to e0a405b Compare July 10, 2026 12:57
@github-actions

Copy link
Copy Markdown

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ 🤖
github.com/cobaltcore-dev/openstack-hypervisor-operator/api/v1 0.00% (ø)
github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/controller 70.27% (+1.36%) 👍

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/cobaltcore-dev/openstack-hypervisor-operator/api/v1/hypervisor_types.go 0.00% (ø) 0 0 0
github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/controller/gardener_node_lifecycle_controller.go 82.09% (+18.14%) 67 (-19) 55 12 (-19) 🎉
github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/controller/hypervisor_controller.go 80.00% (ø) 120 96 24

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/controller/gardener_node_lifecycle_controller_test.go
  • github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/controller/hypervisor_controller_test.go

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.

1 participant