Skip to content

Migrate HypervisorController to SSA status updates - #337

Open
fwiesel wants to merge 1 commit into
mainfrom
ssa-hypervisor-controller
Open

fwiesel wants to merge 1 commit into
mainfrom
ssa-hypervisor-controller

Conversation

@fwiesel

@fwiesel fwiesel commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Replace PatchHypervisorStatusWithRetry with Status().Apply() for the InternalIP scalar and ConditionTypeTerminating condition. Re-fetch the hypervisor after the status apply so the subsequent spec patch sees a fresh resourceVersion.

Seed only ConditionTypeTerminating (the sole condition owned by this controller) so SSA does not claim ownership over conditions written by other controllers.

WithInternalIP is only called when the node reports a NodeInternalIP. Combined with ForceOwnership, applying an empty string would clobber a previously stored valid IP whenever the node briefly reports no IP (e.g. during kubelet restart or bootstrap).

The AgentPodsEvicted=False branch previously returned early with a requeue before running syncLabelsAndAnnotations, so node label changes were not propagated to the Hypervisor while terminating. Move the requeue after the spec patch so labels stay in sync.

Depends on #335 (ssa-conditions-helpers).

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

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: dd73c117-c40c-4a41-93c5-63888cdaefb1

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 ssa-hypervisor-controller

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.

@fwiesel

fwiesel commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@fwiesel
fwiesel force-pushed the ssa-hypervisor-controller branch from a810960 to 15bbea5 Compare July 13, 2026 14:52
@fwiesel
fwiesel force-pushed the ssa-conditions-helpers branch from 181d69b to 7d13627 Compare July 13, 2026 19:59
@fwiesel
fwiesel force-pushed the ssa-hypervisor-controller branch from 15bbea5 to 005a759 Compare July 13, 2026 19:59
@fwiesel
fwiesel force-pushed the ssa-conditions-helpers branch from 7d13627 to dd0de9c Compare July 16, 2026 10:01
@fwiesel
fwiesel force-pushed the ssa-hypervisor-controller branch from 005a759 to d5be889 Compare July 16, 2026 10:12
@fwiesel
fwiesel force-pushed the ssa-conditions-helpers branch from dd0de9c to 40e4306 Compare July 16, 2026 10:23
@fwiesel
fwiesel force-pushed the ssa-hypervisor-controller branch from d5be889 to 00608cb Compare July 16, 2026 10:23
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

This PR is stale because it has been open for 45 days with no activity.

@github-actions github-actions Bot added the stale label Sep 1, 2026
@github-actions

Copy link
Copy Markdown

This PR was closed because it has been inactive for 14 days since being marked as stale.

@github-actions github-actions Bot closed this Sep 16, 2026
@fwiesel fwiesel reopened this Sep 17, 2026
@fwiesel
fwiesel force-pushed the ssa-conditions-helpers branch from 40e4306 to 5125897 Compare September 17, 2026 12:29
@fwiesel
fwiesel force-pushed the ssa-hypervisor-controller branch 3 times, most recently from 41c41e3 to 2b5a811 Compare September 17, 2026 12:54
@fwiesel
fwiesel force-pushed the ssa-conditions-helpers branch from 1e5f268 to b9f51ac Compare September 17, 2026 13:19
@fwiesel
fwiesel force-pushed the ssa-hypervisor-controller branch from 2b5a811 to 5901170 Compare September 17, 2026 13:19
@fwiesel
fwiesel force-pushed the ssa-conditions-helpers branch from b9f51ac to 06083a9 Compare September 17, 2026 13:26
@fwiesel
fwiesel force-pushed the ssa-hypervisor-controller branch from 5901170 to 2ecdbec Compare September 17, 2026 13:26
@github-actions github-actions Bot removed the stale label Sep 18, 2026
Base automatically changed from ssa-conditions-helpers to main September 21, 2026 07:28
Replace PatchHypervisorStatusWithRetry with Status().Apply() for the
InternalIP scalar and ConditionTypeTerminating condition. Re-fetch the
hypervisor after the status apply so the subsequent spec patch sees a
fresh resourceVersion.

Seed only ConditionTypeTerminating (the sole condition owned by this
controller) so SSA does not claim ownership over conditions written by
other controllers.

WithInternalIP is only called when the node reports a NodeInternalIP.
Combined with ForceOwnership, applying an empty string would clobber a
previously stored valid IP whenever the node briefly reports no IP
(e.g. during kubelet restart or bootstrap).

The AgentPodsEvicted=False branch previously returned early with a
requeue before running syncLabelsAndAnnotations, so node label changes
were not propagated to the Hypervisor while terminating. Move the
requeue after the spec patch so labels stay in sync.

Signed-off-by: Fabian Wiesel <fabian.wiesel@sap.com>
@fwiesel
fwiesel force-pushed the ssa-hypervisor-controller branch from 2ecdbec to 347693e Compare September 21, 2026 08:56
@github-actions

Copy link
Copy Markdown

Merging this branch will decrease overall coverage

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

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/controller/hypervisor_controller.go 81.48% (-1.25%) 135 (-4) 110 (-5) 25 (+1) 👎

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.

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