Skip to content

Cortex aggregates#247

Draft
fwiesel wants to merge 5 commits intomainfrom
cortex-aggregates
Draft

Cortex aggregates#247
fwiesel wants to merge 5 commits intomainfrom
cortex-aggregates

Conversation

@fwiesel
Copy link
Contributor

@fwiesel fwiesel commented Feb 26, 2026

No description provided.

Almost the same logic code was used in the aggregates and the onboarding
controller, with the variation that the onboarding controller was also
creating the zone aggregate, and the aggregates controller kept
aggregates modified outside of the controller untouched.

Let's drop that functionality and expect that all aggregates are somehow
created externally (i.e. by another controller), and then we can
combine that logic in one function, that also can be called by the
offboarding controller.

Cortex wants to rely on the aggregates in the status, so we keeping
extra aggregates is unsupported either way.
Three controllers were calling ApplyAggregates, but only one
was maintaining the status. Unify that, so we always an accurate
reflection on the aggregates there.
This is a preparation to keep track of the aggregate ids.
The old functions are unused so let's remove them.
For Cortex, we want the uuids in addition to the names, so
keep track of them in the status.
@github-actions
Copy link

Merging this branch changes the coverage (1 decrease, 1 increase)

Impacted Packages Coverage Δ 🤖
github.com/cobaltcore-dev/openstack-hypervisor-operator/api/v1 0.00% (ø)
github.com/cobaltcore-dev/openstack-hypervisor-operator/applyconfigurations/api/v1 0.00% (ø)
github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/controller 60.51% (-0.86%) 👎
github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/openstack 57.26% (+4.03%) 👍

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/api/v1/zz_generated.deepcopy.go 0.00% (ø) 0 0 0
github.com/cobaltcore-dev/openstack-hypervisor-operator/applyconfigurations/api/v1/hypervisorstatus.go 0.00% (ø) 0 0 0
github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/controller/aggregates_controller.go 62.96% (-12.55%) 27 (-22) 17 (-20) 10 (-2) 💀
github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/controller/decomission_controller.go 70.31% (-2.82%) 64 (-3) 45 (-4) 19 (+1) 👎
github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/controller/onboarding_controller.go 54.10% (-0.94%) 244 (-14) 132 (-10) 112 (-4) 👎
github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/controller/utils.go 77.36% (+3.45%) 53 (+7) 41 (+7) 12 👍
github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/openstack/aggregates.go 97.73% (+11.36%) 44 43 (+5) 1 (-5) 🎉

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/aggregates_controller_test.go
  • github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/controller/decomission_controller_test.go
  • github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/controller/onboarding_controller_test.go
  • github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/controller/utils_test.go
  • github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/openstack/aggregates_test.go
  • github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/openstack/suite_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