Skip to content

Move InstanceHa Enabling/Disabling to own controller#252

Merged
fwiesel merged 1 commit intomainfrom
drop-node-eviction-label-controller
Mar 12, 2026
Merged

Move InstanceHa Enabling/Disabling to own controller#252
fwiesel merged 1 commit intomainfrom
drop-node-eviction-label-controller

Conversation

@fwiesel
Copy link
Contributor

@fwiesel fwiesel commented Mar 4, 2026

The instance ha controller will eventually move out to the instance-ha service
itself. But for now, we keep it as a stand in to reflect the spec value
over the https api.

@fwiesel
Copy link
Contributor Author

fwiesel commented Mar 4, 2026

Based on top of #251.

@fwiesel fwiesel force-pushed the drop-node-eviction-label-controller branch from 36838c5 to 03431a8 Compare March 5, 2026 11:13
@fwiesel fwiesel changed the title Drop node eviction label controller Move InstanceHa Enabling/Disabling to own controller Mar 5, 2026
@fwiesel fwiesel force-pushed the drop-node-eviction-label-controller branch 2 times, most recently from 1bbabe8 to 093fcc0 Compare March 5, 2026 14:53
@fwiesel fwiesel marked this pull request as ready for review March 5, 2026 15:17
@fwiesel fwiesel force-pushed the drop-node-eviction-label-controller branch from 093fcc0 to e58bb18 Compare March 10, 2026 16:18
The instance ha controller will eventually move out to the instance-ha service
itself. But for now, we keep it as a stand in to reflect the spec value
over the https api.
@fwiesel fwiesel force-pushed the drop-node-eviction-label-controller branch from e58bb18 to 1b5fbb9 Compare March 11, 2026 10:20
@github-actions
Copy link

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/cmd 0.00% (ø)
github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/controller 63.05% (+1.08%) 👍

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/cobaltcore-dev/openstack-hypervisor-operator/api/v1/eviction_types.go 0.00% (ø) 0 0 0
github.com/cobaltcore-dev/openstack-hypervisor-operator/api/v1/hypervisor_types.go 0.00% (ø) 0 0 0
github.com/cobaltcore-dev/openstack-hypervisor-operator/cmd/main.go 0.00% (ø) 0 0 0
github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/controller/gardener_node_lifecycle_controller.go 71.43% (ø) 56 40 16
github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/controller/hypervisor_instance_ha_controller.go 81.40% (+81.40%) 43 (+43) 35 (+35) 8 (+8) 🌟
github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/controller/onboarding_controller.go 54.66% (-0.28%) 247 (-6) 135 (-4) 112 (-2) 👎
github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/controller/utils.go 78.26% (+4.35%) 46 36 (+2) 10 (-2) 👍

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

ConditionTypeHypervisorDisabled = "HypervisorDisabled"

// ConditionTypeHaEnabled is the type of condition for signalling if HA is enabled / disabled for the hypervisor
ConditionTypeHaEnabled = "HaEnabled"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not really helpful condition type. Either you want a status bool that reflects the HA service (is-state) of ha enabled or not, and/or you introduce a condition which reflects the communication to the HA service (e.g. HighAvailabilitySynced), which is false in case something gone wrong.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either you want a status bool that reflects the HA service (is-state) of ha enabled or not,

I don't follow. The condition should do exactly that: It should reflect the current state of HA being enabled or not.

and/or you introduce a condition which reflects the communication to the HA service (e.g. HighAvailabilitySynced), which is false in case something gone wrong.

I could add that as well, but I was hoping that this controller would be only temporary, and that condition would then never get set, as the HA service would reflect itself it HA actually enabled, or not.

@fwiesel fwiesel merged commit 66c055f into main Mar 12, 2026
6 checks passed
@fwiesel fwiesel deleted the drop-node-eviction-label-controller branch March 12, 2026 09:31
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.

3 participants