Skip to content

Demo: assert HypervisorMaintenance owns the Evicting condition - #348

Draft
fwiesel wants to merge 1 commit into
mainfrom
demo/evicting-condition-field-owner-test
Draft

Demo: assert HypervisorMaintenance owns the Evicting condition#348
fwiesel wants to merge 1 commit into
mainfrom
demo/evicting-condition-field-owner-test

Conversation

@fwiesel

@fwiesel fwiesel commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Demo-only: shows that the maintenance controller's status patch at internal/controller/hypervisor_maintenance_controller.go:91 correctly stamps FieldOwner=HypervisorMaintenance on the Evicting condition entry.

The new test walks the hypervisor's managedFields, locates the entry for the status subresource, and asserts that the manager owning the k:{"type":"Evicting"} key equals HypervisorMaintenanceControllerName.

Verified negative: temporarily changing the FieldOwner argument at that call site to "WrongOwner" makes both spec instances (auto and manual maintenance modes) fail.

Not intended for merge.

Assert via managedFields that the status patch in
hypervisor_maintenance_controller.go claims ownership of the
Evicting condition entry under the HypervisorMaintenance field
manager. This pins ownership at the write site so future refactors
cannot silently drop the FieldOwner or move the write to a
different controller without failing the test.
@coderabbitai

coderabbitai Bot commented Jul 29, 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 Plus

Run ID: 127df8d9-6490-4d5f-92d5-bcb4829eb7ac

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

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.

@github-actions

Copy link
Copy Markdown

Merging this branch will not change overall coverage

Impacted Packages Coverage Δ 🤖
github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/controller 68.91% (ø)

Coverage by file

Changed unit test files

  • github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/controller/hypervisor_maintenance_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